TreeModelEvent event = new TreeModelEvent(this, path); TreeModelListener[] listeners = getTreeModelListeners();
((MutableTreeNode) node).setUserObject(newValue); int[] ci = null; Object[] c = null; Object[] parentPath = path.getPath(); if (path.getPathCount() > 1) { Object parent = ((TreeNode) node).getParent(); ci = new int[1]; ci[0] = getIndexOfChild(parent, node); node = newValue; path = path.getParentPath().pathByAddingChild(node); c = new Object[1]; c[0] = node; parentPath = path.getParentPath().getPath(); }
  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);      }  }