JComponent () { final DefaultTableModel tableModel = createModel(); myTable = new JBTable(tableModel); myTable.setIntercellSpacing(new Dimension(0, 0)); myTable.setDefaultRenderer(TableItem.class, new MyRenderer()); myTable.setShowGrid(false); myTable.setDragEnabled(false); myTable.setShowHorizontalLines(false); myTable.setShowVerticalLines(false); myTable.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); JPanel tablePanel = ToolbarDecorator.createDecorator(myTable) .setAddAction(new AnActionButtonRunnable() { @Override public void run(AnActionButton button) { FileChooserDescriptor myDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor(); myDescriptor.setTitle(JavaUiBundle.message("add.external.annotations.path.title")); myDescriptor.setDescription(JavaUiBundle.message("add.external.annotations.path.description")); VirtualFile[] files = FileChooser.chooseFiles(myDescriptor, myTable, getProject(), null); final MyTableModel tableModel = (MyTableModel)myTable.getModel(); boolean changes = false; for (final VirtualFile file : files) { if (file != null) { tableModel.addTableItem(new TableItem(file)); changes = true; } } if (changes) { saveData(); TableUtil.selectRows(myTable, new int[] {tableModel.getRowCount() - 1}); } } }).setRemoveAction(new AnActionButtonRunnable() { @Override public void run(AnActionButton button) { final List<Object[]> removedItems = TableUtil.removeSelectedItems(myTable); if (removedItems.size() > 0) { saveData(); } } }).createPanel(); final JPanel mainPanel = new JPanel(new BorderLayout()); mainPanel.add(tablePanel, BorderLayout.CENTER); mainPanel.add(new JBLabel(JavaUiBundle.message("project.roots.external.annotations.description"), UIUtil.ComponentStyle.SMALL, UIUtil.FontColor.BRIGHTER), BorderLayout.NORTH); return mainPanel; }