final String data = "THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG";
final int _multiplier =
getFontMetrics(getFont()).stringWidth(data) / data.length();
TableColumnModel cm = new DefaultTableColumnModel();
for (int i = 0; i < colDefs.length; ++i)
{
ColumnDisplayDefinition colDef = colDefs[i];
int colWidth = colDef.getDisplayWidth() * _multiplier;
if (colWidth > IDataSetViewer.MAX_COLUMN_WIDTH * _multiplier)
{
colWidth = IDataSetViewer.MAX_COLUMN_WIDTH * _multiplier;
}
TableColumn col = new TableColumn(i, colWidth,
CellComponentFactory.getTableCellRenderer(colDefs[i]), null);
col.setHeaderValue(colDef.getColumnName());
cm.addColumn(col);
}
setColumnModel(cm);
_colDefs = colDefs;
// set up cell editors on first row
for (int i=0; i< colDefs.length; i++) {
cm.getColumn(i).setCellEditor(
CellComponentFactory.getInCellEditor(this, _colDefs[i]));
}
// the second row contains a multi-line description,