Fixed handling of default columns width.

This commit is contained in:
LevelX2 2015-04-27 23:13:00 +02:00
parent 6faae6066e
commit efb02f633c

View file

@ -1199,17 +1199,14 @@ class TableTableModel extends AbstractTableModel {
// set the column width from saved value or defaults // set the column width from saved value or defaults
int[] widths = Util.getIntArrayFromString(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_TABLES_COLUMNS_WIDTH, null)); int[] widths = Util.getIntArrayFromString(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_TABLES_COLUMNS_WIDTH, null));
if (widths != null) { int i = 0;
int lengthW = widths.length; for (int width : defaultColumnsWidth) {
int i = 0; if (widths != null && widths.length > i) {
for (int width : defaultColumnsWidth) { width = widths[i];
if (lengthW > i) { }
width = widths[i]; TableColumn column = table.getColumnModel().getColumn(i++);
} column.setWidth(width);
TableColumn column = table.getColumnModel().getColumn(i++); column.setPreferredWidth(width);
column.setWidth(width);
column.setPreferredWidth(width);
}
} }
// set the column order // set the column order