Object cell = path.getLastPathComponent();  if (treeModel != null) { Object root = treeModel.getRoot(); if (!tree.isRootVisible() && tree.isExpanded(new TreePath(root))) root = getNextNode(root);  Point loc = getCellLocation(0, 0, tree, treeModel, cell, root); return getCellBounds(loc.x, loc.y, cell); }
row = getRowForPath(tree, path); cell = path.getLastPathComponent(); bounds = new Rectangle(0, row * getRowHeight(), 0, 0);
  public Rectangle getPathBounds(JTree tree, TreePath path)  {    if (path != null)      {        Object cell = path.getLastPathComponent();        if (treeModel != null)          {            Object root = treeModel.getRoot();            if (!tree.isRootVisible() && tree.isExpanded(new TreePath(root)))              root = getNextNode(root);            Point loc = getCellLocation(0, 0, tree, treeModel, cell, root);            return getCellBounds(loc.x, loc.y, cell);          }      }    return null;  }