void (AnActionButton button) { TableUtil.stopEditing(table); final int rowCount = table.getRowCount(); if (tableModel instanceof ListTableModel && producer != null) { //noinspection unchecked ((ListTableModel)tableModel).addRow(producer.createElement()); } else { tableModel.addRow(); } if (rowCount == table.getRowCount()) return; final int index = table.getModel().getRowCount() - 1; table.setRowSelectionInterval(index, index); table.setColumnSelectionInterval(0, 0); table.editCellAt(index, 0); TableUtil.updateScroller(table); //noinspection SSBasedInspection SwingUtilities.invokeLater(() -> { final Component editorComponent = table.getEditorComponent(); if (editorComponent != null) { final Rectangle bounds = editorComponent.getBounds(); table.scrollRectToVisible(bounds); IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(editorComponent, true)); } }); }