boolean () { TreePath path = myTree.getSelectionPath(); if (path == null) { return false; } DefaultMutableTreeNode node = (DefaultMutableTreeNode)path.getLastPathComponent(); Object userObject = node.getUserObject(); return userObject instanceof NodeDescriptor && !isFirst(node); }