if (!mod.isLeaf(last) && tree.isCollapsed(path))
if (!treeModel.isLeaf(last) && tree.isCollapsed(path))
		public void actionPerformed(ActionEvent e)  {      TreeModel mod = tree.getModel();      Object last = tree.getLeadSelectionPath().getLastPathComponent();      if (e.getActionCommand().equals("selectParent"))        {          TreePath path = new TreePath(getPathToRoot(last, 0));          Object p = getParent(mod.getRoot(), last);          if (!mod.isLeaf(last) && tree.isExpanded(path))            tree.collapsePath(path);          else if (p != null)            selectPath(tree, new TreePath(getPathToRoot(p, 0)));        }      else if (e.getActionCommand().equals("selectChild"))        {          TreePath path = new TreePath(getPathToRoot(last, 0));          if (!mod.isLeaf(last) && tree.isCollapsed(path))            tree.expandPath(path);          else            {              Object next = getNextVisibleNode(last);              if (next != null)                selectPath(tree, new TreePath(getPathToRoot(next, 0)));            }        }  }