|
Re: maximizing java.awt.Frame
|
Posted: Mar 17, 2002 9:39 AM
|
|
If you are using JDK v1.4 then you have a method called setExtendedState for java.awt.Frame and you can use it as follows to maximize your frame. yourframe f = new .... ; f.setExtendedState ( java.awt.Frame.MAXIMIZED_BOTH ) ;
However, prior to JDK 1.4 you don't have a method to set the frame in maximized state directly. However, it is easy to accomplish. 1. Move the frame to (0,0) position. 2. set the width and height of the frame same as width and height of the screen.
// Following is the code which you need to maximize your frame prior to JDK1.4 f.move(0,0); f.resize(java.awt.Toolkit.getDefaultToolkit().getScreenSize ());
Thanks Kishori
|
|