void (final TreePath path) { CellEditor editor = getCellEditor(); if (editor != null && editor.isCellEditable(null) && isPathEditable(path)) { getSelectionModel().clearSelection(); getSelectionModel().setSelectionPath(path); myEditingRow = getRowForPath(path); myEditorComponent = (JComponent)getCellEditor() .getTreeCellEditorComponent(this, path.getLastPathComponent(), isPathSelected(path), isExpanded(path), treeModel.isLeaf(path.getLastPathComponent()), myEditingRow); putEditor(path); if (myEditorComponent.isFocusable()) { myEditorComponent.requestFocusInWindow(); } SwingUtilities.invokeLater(() -> scrollPathToVisible(path)); } }