JFrame in full screen Java

Yoda picture Yoda · Jul 20, 2012 · Viewed 275.5k times · Source

I will be doing a project soon and I will have to use full screen mode in it.

It will draw some graphics in the window. It would be convienient if I use JFrame or something similar.

I don't know what the final resolution of the screen will be. Please tell me if the graphics will be automaticly rescaled?

JFrame jf = new JFrame();
jf.setSize(1650,1080);
//make it fullscreen;
//now is everything is going to be rescaled so it looks like the original?

Answer

Reimeus picture Reimeus · Jul 20, 2012

Add:

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