JFrame Unmaximize?

Hi,

I'm currently programming a GUI application that starts maximized when you run it. However, if you click the maximize button to make it resizable, it becomes extremely small (you can't see the caption, buttons, or anything...) and needs to be resized manually.

Is there any way I can set a preferred size for when you unmaximize it? I tried "setPreferredSize()" but it doesn't work.

Any help would be appreciated.

Thanks,

Wojciech

[474 byte] By [VoytekGa] at [2007-11-27 2:40:37]
# 1
in your constructor code, just before your maximize line, add thisframe.pack();//<-frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
Michael_Dunna at 2007-7-12 3:03:40 > top of Java-index,Desktop,Core GUI APIs...
# 2
Thank you very much! Works like a charm!
VoytekGa at 2007-7-12 3:03:40 > top of Java-index,Desktop,Core GUI APIs...