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!

GridBagLayout and vertical space...

843804Oct 12 2004 — edited Oct 12 2004
All,

I'm trying to set up a panel such that it has a few subcomponents, two of which are GridBagLayout due to the necessity of having irregularly sized columns.

The screen looks something like this:
----------
|Panel1  |
|--------|
|        |
|Panel2  |
|        |
|--------|
|Panel3  |
|--------|
|        |
|Panel4  |
|        |
|--------|
|Panel5  |
----------
/
Now Panel2 is a GridBagLayout, as is Panel4.

Panel4 however starts out empty and gets filled later on in response to certain events. It's bound to a scrollPane.

What happens though is that initially Panel2 and Panel4 start out about the same height, trying to equalize vertical sizes I guess. I don't mind Panel4 filling up extra space, in fact, that's desireable, but Panel2 is to have fixed fields on it, so I would prefer if it were to take up only as much height as it needed.

So is there any method whereby I can make Panel2 only take up as much vertical space as it needs, and have Panel4 behave as it is currently (taking up whatever is left over)? I also need Panels 1, 3, and 5 to be unaffected by this size-wise.

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 9 2004
Added on Oct 12 2004
3 comments
176 views