JBTable () { final String[] names = { JavaRefactoringBundle.message("migration.type.column.header"), JavaRefactoringBundle.message("migration.old.name.column.header"), JavaRefactoringBundle.message("migration.new.name.column.header")}; // Create a model of the data. TableModel dataModel = new AbstractTableModel() { @Override public int getColumnCount() { return 3; } @Override public int getRowCount() { return myMigrationMap.getEntryCount(); } @Override public Object getValueAt(int row, int col) { MigrationMapEntry entry = myMigrationMap.getEntryAt(row); if (col == 0) { if (entry.getType() == MigrationMapEntry.PACKAGE && entry.isRecursive()) { return JavaRefactoringBundle.message("migration.package.with.subpackages"); } else if (entry.getType() == MigrationMapEntry.PACKAGE && !entry.isRecursive()) { return JavaRefactoringBundle.message("migration.package"); } else { return JavaRefactoringBundle.message("migration.class"); } } String suffix = (entry.getType() == MigrationMapEntry.PACKAGE ? ".*" : ""); if (col == 1) { return entry.getOldName() + suffix; } else { return entry.getNewName() + suffix; } } @Override public String getColumnName(int column) { return names[column]; } @Override public Class<String> getColumnClass(int c) { return String.class; } @Override public boolean isCellEditable(int row, int col) { return false; } @Override public void setValueAt(Object aValue, int row, int column) { } }; // Create the table myTable = new JBTable(dataModel); myTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); myTable.setVisibleRowCount(10); return myTable; }