void () { final int columns = myTable.getTable().getColumnCount(); final TableColumnModel columnModel = myTable.getTable().getColumnModel(); int tableWidth = 0; final int nameWidth; if (myStateBean.myColumnSize != null && myStateBean.myColumnSize.size() == columns + 1) { for (int column = 0; column < columns; column++) { final int width = myStateBean.myColumnSize.get(column); columnModel.getColumn(column).setPreferredWidth(width); tableWidth += width; } nameWidth = myStateBean.myColumnSize.get(columns); } else { for (int column = 0; column < columns; column++) { final int width = Math.max(getStringWidth(myModel.getColumnName(column)), getColumnWidth(column)); columnModel.getColumn(column).setPreferredWidth(width); tableWidth += width; } nameWidth = Math.max(getStringWidth(myModel.getColumnName(0)), JBUIScale.scale(150)); } myTable.setColumnProportion(((float)tableWidth) / (nameWidth + tableWidth) / columns); }