if (!path.equals(newValue))
Object node = path.getLastPathComponent(); if (node instanceof MutableTreeNode)
  public void valueForPathChanged(TreePath path, Object newValue)  {    if (!path.equals(newValue))      {        TreeModelEvent event = new TreeModelEvent(this, path);        TreeModelListener[] listeners = getTreeModelListeners();                for (int i = listeners.length - 1; i >= 0; --i)          listeners[i].treeNodesChanged(event);      }  }