I am using JDK1.4 and trying to maximize my JFrame. In JDK1.3 I used to setBounds(0, 0, screen.height, screen.width) but that didn't dock the window, just made it as big as the screen. You could still mazimize the JFrame to dock the window. With JDK1.4 you are suposed to be able to setExtendedState(JFrame.MAXIMIZE_BOTH). Below is my code and it is not working. I don't get a maximized frame.
------------------ Happy Coding, Gregg Bolinger [This message has been edited by Gregg Bolinger (edited October 17, 2001).]
I had problems with this one too... messed around with it for a long time and thought that it was broken... turns out that you have to call frame.setExtendedState( Frame.MAXIMIZED_BOTH ) after the frame has been initially set visible... not that intuitive if you want a frame to open maximized... but at least now there's a way to do it... BTW, you can use the isFrameStateSupported(int) method of Toolkit to see if a certain frame state is supported in a certain platform.
Here's a working version of your program...
Write once, run anywhere, because there's nowhere to hide! - /. A.C.