Link to home
Start Free TrialLog in
Avatar of confusednewguy
confusednewguy

asked on

how to maximize JFrame

How can I expand my JFrame so it occupies the entire display area of the monitor regardless of screen resolution?
SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kjetijo
kjetijo

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