}
private void setSizes() {
ColumnInfo[] columns = getListTableModel().getColumnInfos();
for (int i = 0; i < columns.length; i++) {
ColumnInfo columnInfo = columns[i];
TableColumn column = getColumnModel().getColumn(i);
if (columnInfo.getWidth(this) > 0) {
int wight = columnInfo.getWidth(this);
column.setMaxWidth(wight);
column.setMinWidth(wight);
}
else if (columnInfo.getMaxStringValue() != null) {
String maxStringValue = columnInfo.getMaxStringValue();
int width = getFontMetrics(getFont()).stringWidth(maxStringValue) + columnInfo.getAdditionalWidth();
column.setPreferredWidth(width);
column.setMaxWidth(width);
}
else {
final String preferredValue = columnInfo.getPreferredStringValue();
if (preferredValue != null) {
int width = getFontMetrics(getFont()).stringWidth(preferredValue) + columnInfo.getAdditionalWidth();
column.setPreferredWidth(width);
}
}
}
}