Feb 04
|
A frame can be maximized using the Jframe method setExtendedState() as shown in the example below.
frame.setExtendedState( frame.getExtendedState() | JFrame.MAXIMIZED_BOTH);
CategoriesArchives
|
A frame can be maximized using the Jframe method setExtendedState() as shown in the example below. frame.setExtendedState( frame.getExtendedState() | JFrame.MAXIMIZED_BOTH);
You cannot have a modal JFrame. Use a JDialog if you need a modal window.
The GraphicsDevice class has a method setFullScreenWindow() that allows you to specify the window to display in full screen mode on that device. JFrame frame = new JFrame(); GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice[] devices = environment.getScreenDevices(); // we will assume the screen of interest is the 1st one GraphicDevice device = devices[0]; if (device.isFullScreenSupported()) { // make frame undecorated and not resizeable frame.setUndecorated(true); frame.setResizable(false); // go into full screen mode device.setFullScreenWindow(frame); frame.validate(); } |
|