// Adjust the constraints if necessary
int numChildren = comp.getComponentCount();
for ( i = 0; i < numChildren; i++ ) {
JComponent c = (JComponent)comp.getComponent( i );
TableLayoutConstraints constraints = tableLayout.getConstraints( c );
// If the row has more than one component make the last column the preferred size.
int numCells = c.getComponentCount();
if ( numCells > 1 )
tableLayout.setColumn( constraints.col1, TableLayout.FILL );
}