maximized window

hi!can someone tell me how to set the state of a window in maximized form so that the user will not have to do it manually? any codeshelp please
[165 byte] By [jangelja] at [2007-9-28 15:04:10]
# 1

If your window is a subclass of Frame, you can use this method:

setExtendedState(int state)

where state is the state of the frame, you must use the value MAXIMIZE_BOTH.

Try this example:

public class MaximizedFrame {

public static void main(String[] args) {

JFrame frame = new JFrame();

frame.pack();

frame.setExtendedState(JFrame.MAXIMIZED_BOTH);

frame.setVisible(true);

}

}

Good Luck!

amlga at 2007-7-12 11:46:49 > top of Java-index,Archived Forums,Java Programming...
# 2
In your Frame:setExtendedState (MAXIMIZED_BOTH);You can check whether your platform supports the state by invokingToolkit.getDefaultToolkit ().isFrameStateSupported (MAXIMIZED_BOTH);Kind regards, Levi
levi_ha at 2007-7-12 11:46:49 > top of Java-index,Archived Forums,Java Programming...