TreeNode parent = node.getParent();
TreeModel mod = tree.getModel(); Object parent = getParent(mod.getRoot(), node);
  TreeNode getPreviousSibling(TreeNode node)  {    TreeNode parent = node.getParent();    if (parent == null)      return null;    int index = parent.getIndex(node) - 1;    if (index < 0)      return null;    return parent.getChildAt(index);  }