editingPath = null; editingRow = -1; stopEditingInCompleteEditing = false; if (editingComponent != null) tree.remove(editingComponent.getParent()); editingComponent = null; if (cellEditor != null) { if (cellEditor instanceof DefaultTreeCellEditor) tree.removeTreeSelectionListener((DefaultTreeCellEditor) cellEditor); cellEditor.removeCellEditorListener(cellEditorListener); setCellEditor(null); createdCellEditor = false; } tree.requestFocusInWindow(false); editorTimer.stop(); isEditing = false; validCachedPreferredSize = false; tree.repaint();
cancelEditing(tree);
    public void editingCanceled(ChangeEvent e)    {      editingPath = null;      editingRow = -1;      stopEditingInCompleteEditing = false;      if (editingComponent != null)        tree.remove(editingComponent.getParent());      editingComponent = null;      if (cellEditor != null)        {          if (cellEditor instanceof DefaultTreeCellEditor)            tree.removeTreeSelectionListener((DefaultTreeCellEditor) cellEditor);          cellEditor.removeCellEditorListener(cellEditorListener);          setCellEditor(null);          createdCellEditor = false;        }      tree.requestFocusInWindow(false);      editorTimer.stop();      isEditing = false;      validCachedPreferredSize = false;      tree.repaint();    }