Jframe in Full Screen Java

JFrame in full screen Java

Add:

frame.setExtendedState(JFrame.MAXIMIZED_BOTH); 
frame.setUndecorated(true);
frame.setVisible(true);

How to make full screen Java app.?

may be you used 'null' for your JFrame

setLayout(null).

Please use your required layout for the JFrame

Java show fullscreen swing application with taskbar without titlebar

Works for one desktop

    Rectangle r = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setUndecorated(true);
frame.setSize(r.width, r.height);
frame.setVisible(true);

Edit: Works for multiple desktops too!

How to get closeable full screen in a JFrame window?

The exception is explained here: Exception in thread "AWT-EventQueue-0" java.awt.IllegalComponentStateException: The frame is displayable

A workaround is described here: Dynamically show and hide JFrame decorations



Related Topics



Leave a reply



Submit