I'm not sure if GridBagLayoutManager is the only layout manager that does this, but here is my problem. I have 4 controls layed out horizontally in a GridBagLayout. To keep things simple for this example, each control get's an equal 1/4 of the form, and each control resizes with the same ratio as the other controls. The four controls are JTextField's where each text field maps to a column in a record from a ResultSet. Additional controls on the form allow one to navigate through the records.
If I navigate from one record to the next, then the text fields update their text to show the new data. However, the text fields also get automatically resized in proportion to the amount of text they are showing... text fields with a large amount of data expand in size, and text fields with a smaller amount of data get squished. If I run through 10 records in a ResultSet, then the controls are always resizing themselves and it looks quite bizarre to say the least.
What I would like to do is prevent these controls from resizing, unless (and until) the underlying container gets resized. So if I resize the window, then I would like the controls to resize (according to the "weight x" variable in the Layout), but I don't want the controls to resize just because the amount of text they are showing becomes more or less.
Anybody have any ideas here?