Node () { ThreadingAssertions.assertEventDispatchThread(); TreePath path = myTree.getLeadSelectionPath(); Object node = path == null ? null : path.getLastPathComponent(); return node instanceof Node ? (Node)node : null; }