private void fixCellSize() { this.heatmap.setRowHeight(0, getMaxColumnNameLength()); range(1, getVisibleRowNames().size() + 1).forEach(row -> { this.heatmap.setRowHeight(row, this.cellSize); }); for (int i = 0; i < this.heatmap.getColumnModel().getColumnCount(); i++) { TableColumn c = this.heatmap.getColumnModel().getColumn(i); c.setMinWidth(this.cellSize); c.setMaxWidth(this.cellSize); c.setPreferredWidth(this.cellSize); } int maxRowWidth = getMaxRowNameLength(); TableColumn rowNamesColumn = this.heatmap.getColumnModel().getColumn(0); rowNamesColumn.setMinWidth(maxRowWidth); rowNamesColumn.setMaxWidth(maxRowWidth); rowNamesColumn.setPreferredWidth(maxRowWidth); }