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);

written by objects \\ tags: ,

Jan 31

You cannot have a modal JFrame. Use a JDialog if you need a modal window.

written by objects \\ tags: , ,

Sep 30

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();
} 

written by objects \\ tags: