Try avoiding the setPreferredSize, setMaximumSize and setMinimumSize in a GridBagLayout setup. You will find that they are not reliable and most of the time getting overridden by the settings from the GrigBagContraints. From the later, use the following properties to size your components: fill, gridheight, gridwidth. This is especially true for components embedded in JScrollPane where the viewport will not reflect the actual size of his child component(s).
Nik
2010-09-07 15:51:40