Java 2D - Setting the size of Jframe

In my program there is a main Jframe.In that i placed a button and when i click the button another Jframe have to come,so that is coming but my problem is the size of the window is very small and i hve to drag it to the original size.how can i over come this?
[266 byte] By [govind_kailasa] at [2007-11-26 23:28:21]
# 1

Hi,

after you created the user interface of your new JFrame, you have to call the pack() method of your new JFrame instance. This will size your JFrame accordingly to the interface widgets it contains.

You may as well positioned the min, max and preferred size by the setMinimumSize(), setMaximumSize() and setPreferredSize() methods if you want to force those.

Cheers.

Vince.

blendinga at 2007-7-10 14:38:00 > top of Java-index,Security,Cryptography...
# 2
tanx dude..finally that worked out. :)
govind_kailasa at 2007-7-10 14:38:00 > top of Java-index,Security,Cryptography...