void () { DefaultMutableTreeNode lastSelectedPathComponent = (DefaultMutableTreeNode)myTree.getLastSelectedPathComponent(); super.cancelEditing(); if (myShouldRepaint) { refreshNode(root); } restoreSelection(lastSelectedPathComponent); }