Object node = treeModel.getRoot(); if (!tree.isRootVisible() && tree.isExpanded(new TreePath(getPathToRoot(node, 0)))) node = getNextNode(node);  for (int i = 0; i < row; i++) node = getNextVisibleNode(node);  if (node == null) return null;  return new TreePath(getPathToRoot(node, 0));
Object[] nodes = currentVisiblePath.getPath(); if (row < nodes.length) return new TreePath(getPathToRoot(nodes[row], 0));
  public TreePath getPathForRow(JTree tree, int row)  {    if (treeModel != null)      {        Object node = treeModel.getRoot();        if (!tree.isRootVisible()            && tree.isExpanded(new TreePath(getPathToRoot(node, 0))))          node = getNextNode(node);        for (int i = 0; i < row; i++)          node = getNextVisibleNode(node);        if (node == null)          return null;        return new TreePath(getPathToRoot(node, 0));      }    return null;  }