void (ActionEvent e) { TableUtil.stopEditing(table); tableModel.addRow(); final int index = tableModel.getRowCount() - 1; table.editCellAt(index, 0); table.setRowSelectionInterval(index, index); table.setColumnSelectionInterval(0, 0); table.getParent().repaint(); final Component editorComponent = table.getEditorComponent(); if (editorComponent != null) { final Rectangle bounds = editorComponent.getBounds(); table.scrollRectToVisible(bounds); IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(editorComponent, true)); } }