Hoffa
asked on
maximize JFrame
how can i maximize a JFrame?
frame.setState does not offer maximize...
thnx
frame.setState does not offer maximize...
thnx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
L
frame.setSize(Toolkit.getD
is the simple way to mixize a JFrame. But if you want to maximize a JFrame instead of resizing it. You can use the new functions in the following link:
http://java.sun.com/j2se/1.4/docs/guide/awt/AWTChanges.html#fullscreen
frame.setState(Frame.NORMA
Toolkit toolkit = Toolkit.getDefaultToolkit(
Dimension dimension = toolkit.getScreenSize();
frame.setSize(dimension);
Of course, the os will not treat this as a maximized frame, so in general this is a poor substitute for simulating maximize. Furthermore, on Windows this technique does not respect the toolbar. There are non-portable methods using JNI which I have used to do the same on Win32.
On the bright side, JDK 1.4 looks like it will provide direct support for this capability -- finally.
Best regards,
Jim Cakalic