void (FilterAction filter) { final JBTable table = myFilterTable.getTable(); TableUtil.stopEditing(table); table.setRowHeight(table.getRowHeight()); // reset int index = 0; final int max = myTableModel.getRowCount(); for (; index < max; index++) { if (filter.position() < myTableModel.getItem(index).position()) { break; } } if (index == 0) { myTableModel.addRow(myHeader); index = 1; } myTableModel.insertRow(index, filter); table.editCellAt(index, 0); table.setRowSelectionInterval(index, index); table.setColumnSelectionInterval(0, 0); TableUtil.updateScroller(table); final Component editorComponent = table.getEditorComponent(); if (editorComponent != null) { table.scrollRectToVisible(editorComponent.getBounds()); IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(editorComponent, true)); } }