&& tree.isExpanded(new TreePath(((DefaultMutableTreeNode) root) .getPath())))
&& tree.isExpanded(new TreePath(root)))
	public Rectangle getPathBounds(JTree tree, TreePath path)	{      if (path != null)      {         Object cell = path.getLastPathComponent();         TreeModel mod = tree.getModel();         DefaultMutableTreeNode root = (DefaultMutableTreeNode) mod.getRoot();         if (!tree.isRootVisible()               && tree.isExpanded(new TreePath(((DefaultMutableTreeNode) root)                     .getPath())))            root = root.getNextNode();         Point loc = getCellLocation(0, 0, tree, mod, cell, root);         return getCellBounds(loc.x, loc.y, cell);      }		return null;	}