void (int columnToPack) { TableColumn column = getColumnModel().getColumn(columnToPack); int currentWidth = column.getWidth(); int expandedWidth = getExpandedColumnWidth(columnToPack); int newWidth = getColumnModel().getColumnMargin() + (currentWidth >= expandedWidth ? getPreferredHeaderWidth(columnToPack) : expandedWidth); setResizingColumn(column); column.setWidth(newWidth); Dimension tableSize = JBTable.this.getSize(); tableSize.width += newWidth - column.getWidth(); JBTable.this.setSize(tableSize); // let the table update it's layout with resizing column set ApplicationManager.getApplication().invokeLater(() -> setResizingColumn(null)); }