Create a Window without a Frame in Java

This Java tutorial will show how to create a Swing window without a border or frame in Java. This type of window is often used for creating a splash screen or about box. Creating a window without a frame can be done by using the JWindow class. This class will create a window that does not have a title bar, minimize button, maximize button, close button, or resizing frame.

JWindow window = new JWindow();

//Set the size of the window
window.setSize(400, 250);

//Show the window
window.setVisible(true);

Since a JWindow does not let the user move the window, you may want to center the window on the screen for the user.


0 comments:

Post a Comment