GridBagLayout and widget replacement

Is there a way to lock or fix the cell size of a GridBagLayout after I've used it to add components to a JPanel? I need to dynamically replace components in the panel, but removing a component and adding a different one causes the grid to resize. For example, replacing a JComboBox with a JLabel would make that row in the GridBag shrink vertically, because the JLabel is shorter than the JComboBox - this messes up the spacing between other components in the grid. I'd like to prevent the resizing, if possible.

thanks in advance for any help.

[559 byte] By [orzechowskida] at [2007-10-3 2:51:06]
# 1
You could try setting the preferred size of the label equal to the preferred size of the combo box before adding it.
camickra at 2007-7-14 20:39:58 > top of Java-index,Desktop,Core GUI APIs...
# 2
That did the trick - thanks. Could've sworn I tried that already, but guess not...
orzechowskida at 2007-7-14 20:39:58 > top of Java-index,Desktop,Core GUI APIs...