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!

Fixed Column Width with GridBagLayout?

843805Sep 11 2006 — edited Sep 12 2006
Is there any way to get the columns in a GridBagLayout to have equal widths? I cannot use a GridLayout because I need varying row heights which don't necessarily line up in the two columns. I guess I could try putting two gridbags side by side in a grid, but I'd prefer to find a way to do it just using one gridbag. I've tried using fillx, but that doesn't help. With or without it, the columns line up, but one will be larger or smaller than the other, even though I've set weightx to 1 for each entry.

I have multiple panels coming in from different sources, each with a GridBagLayout, which I need to display one on top of another on the screen. Each has two columns, but the column widths don't match, which is what I'm trying to fix.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 10 2006
Added on Sep 11 2006
2 comments
507 views