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