- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to create a Borderless Window in Java?
To create a borderless window in Java, do not decorate the window. The following is an example to create a BorderLess Window −
Example
package my; import java.awt.GraphicsEnvironment; import java.awt.GridLayout; import java.awt.Point; import javax.swing.JLabel; import javax.swing.JPasswordField; import javax.swing.JTextField; import javax.swing.JWindow; import javax.swing.SwingConstants; public class SwingDemo { public static void main(String[] args) throws Exception { JWindow frame = new JWindow(); JLabel label1, label2, label3; frame.setLayout(new GridLayout(2, 2)); label1 = new JLabel("Id", SwingConstants.CENTER); label2 = new JLabel("Age", SwingConstants.CENTER); label3 = new JLabel("Password", SwingConstants.CENTER); JTextField emailId = new JTextField(20); JTextField rank = new JTextField(20); JPasswordField passwd = new JPasswordField(); passwd.setEchoChar('*'); frame.add(label1); frame.add(label2); frame.add(label3); frame.add(emailId); frame.add(rank); frame.add(passwd); Point center = GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint(); int width = 500; int height = 200; frame.setBounds(center.x - width / 2, center.y - height / 2, width, height); frame.setVisible(true); } }
Output
- Related Articles
- How to create a Titleless and Borderless JFrame in Java?
- How to create a borderless fullscreen application using Python-3 Tkinter?
- How to center a Window in Java?
- How to create a browser window example with CSS?
- How do we create a sub window in HTML?
- How do I create a popup window in Tkinter?
- How to create a child window and communicate with parents in Tkinter?
- How to create a popup chat window with CSS and JavaScript?
- How do I create a popup window using Tkinter?
- How do I create a popup window using Tkinter Program?
- How to create a plot in R with a different plot window size using plot function?
- How to create a HashSet in Java?
- How to create a thread in Java
- How to create a vertical toolbar in Java?
- How to create a date spinner in Java?

Advertisements