void (ColumnInfo[] columnInfos, List<? extends T> data) { final boolean columnsChanged = myTableModel.setColumnInfos(columnInfos); final boolean dataChanged = !data.equals(myTableModel.getItems()); final int oldRowCount = myTableModel.getRowCount(); if ((dataChanged || columnsChanged) && myTable.isEditing()) { myTable.getCellEditor().cancelCellEditing(); } if (dataChanged) { final int selectedRow = myTable.getSelectedRow(); myTableModel.setItems(new ArrayList<>(data)); if (selectedRow >= 0 && selectedRow < myTableModel.getRowCount()) { myTable.getSelectionModel().setSelectionInterval(selectedRow, selectedRow); } } myTableModel.cacheValues(); final int rowCount = myTableModel.getRowCount(); final int columnCount = myTableModel.getColumnCount(); myCachedRenderers = new TableCellRenderer[rowCount][columnCount]; for (int row = 0; row < rowCount; row++) { for (int column = 0; column < columnCount; column++) { final TableCellRenderer superRenderer = myTable.getSuperCellRenderer(row, column); myCachedRenderers[row][column] = getTableCellRenderer(row, column, superRenderer, myTableModel.getItems().get(row)); } } if (columnsChanged || oldRowCount == 0 && rowCount != 0) { adjustColumnWidths(); } myTable.revalidate(); myTable.repaint(); }