• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 459
  • Last Modified:

how to maximize JFrame

How can I expand my JFrame so it occupies the entire display area of the monitor regardless of screen resolution?
0
confusednewguy
Asked:
confusednewguy
2 Solutions
 
hoomanvCommented:
instead of
    frame.setVisible(true);
use
    GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().setFullScreenWindow(frame);

you can also do
    frame.setUndecorated(true);
to be completely fullscreen
0
 
kjetijoCommented:
By using a toolkit you can get the resolution of the screen... In one line you could just write:

setSize(Toolkit.getDefaultToolkit().getScreenSize());

This won't put you into a fullscreen-mode since you'll still have the borders around the JFrame, and you can still resize it. To get fullscreen, you use the command, as hoomanv allready said:

setUndecorated(true);
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now