Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Dynamically expand/shrink a JFrame

843806Jul 3 2008 — edited Jul 3 2008
I am trying to create a GUI, which is built on a JFrame, and has two Panels, one at the top, and one at the bottom. What I want to be able to do programmatically is to expand the size of the frame by some set amount, and so open a space up between the two Panels, and show another component (JTable), then when finished with, close it up again.

I have laid out my JFrame, and if I manually resize it by dragging the bottom of the frame, the lower panel remains anchored on the bottom, and a gap appears in the middle. If I do this programmatically by calling setSize() on the frame with an increased Y coordinate the form resizes, but the lower panel remains where it was, adjacent to the upper panel, and the gap is at the bottom.

I have designed this in Netbeans, so the layout is all done for me.

Can somebody suggest how I can make this work, or give a suggestion for something to try.

Thanks in anticipation
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 31 2008
Added on Jul 3 2008
3 comments
924 views