TreeNode parent = node.getParent();
TreeModel mod = tree.getModel(); Object parent = getParent(mod.getRoot(), node);
  TreeNode getNextSibling(TreeNode node)  {    TreeNode parent = node.getParent();    if (parent == null)      return null;    int index = parent.getIndex(node) + 1;        if (index == parent.getChildCount())      return null;    return parent.getChildAt(index);  }