int (int column, int width, @NotNull JTable table) { TableColumn tableColumn = table.getColumnModel().getColumn(column); int headerWidth = new ColumnHeaderRenderer().getTableCellRendererComponent(table, tableColumn.getHeaderValue(), false, false, -1, column).getPreferredSize().width + 4; int newWidth = Math.max(width, headerWidth) + 2 * table.getIntercellSpacing().width; tableColumn.setPreferredWidth(Math.min(Math.max(newWidth, tableColumn.getPreferredWidth()), MAX_INIT_COLUMN_WIDTH)); return newWidth; }