TreeModel mod = tree.getModel();
if (treeModel != null) { Object root = treeModel.getRoot();
	public void paint(Graphics g, JComponent c)	{		JTree tree = (JTree) c;		TreeModel mod = tree.getModel();    if (mod != null)      {      Object root = mod.getRoot();            if (!tree.isRootVisible())      tree.expandPath(new TreePath(root));            paintRecursive(g, 0, 0, 0, 0, tree, mod, root);            if (hasControlIcons())         paintControlIcons(g, 0, 0, 0, 0, tree, mod, root);	}  }