TreePath curr = new TreePath(getPathToRoot(((TreeNode) node), 0));
TreePath curr = new TreePath(getPathToRoot(node, 0));
   void paintNode(Graphics g, int x, int y, JTree tree, Object node,         boolean isLeaf)	{    TreePath curr = new TreePath(getPathToRoot(((TreeNode) node), 0));      boolean selected = tree.isPathSelected(curr);      boolean expanded = false;    boolean hasIcons = false;      if (tree.isVisible(curr))      {        DefaultTreeCellRenderer dtcr = (DefaultTreeCellRenderer)                 createDefaultCellRenderer();         if (!isLeaf)            expanded = tree.isExpanded(curr);        Icon icon = null;        if (!isLeaf && expanded)          icon = dtcr.getOpenIcon();        else if (!isLeaf && !expanded)          icon = dtcr.getClosedIcon();        else          icon = dtcr.getLeafIcon();                if (icon.getIconHeight() > -1 && icon.getIconWidth() > -1)          hasIcons = true;                 Component c = dtcr.getTreeCellRendererComponent(tree, node, selected,               expanded, isLeaf, 0, false);        if (hasIcons)          {		if (selected)		{            Rectangle cell = getPathBounds(tree, curr);            g.setColor(dtcr.getBackgroundSelectionColor());                g.fillRect(cell.x + icon.getIconWidth()/2, cell.y, cell.width,                  cell.height);                                if (curr.equals(tree.getLeadSelectionPath()))                  {                    g.setColor(UIManager.getLookAndFeelDefaults().getColor(                    "Tree.selectionBorderColor"));                    g.drawRect(cell.x + icon.getIconWidth()/2, cell.y,                                cell.width, cell.height);                  }		}			    g.translate(x, y);    c.paint(g);    g.translate(-x, -y);  }        else           rendererPane.paintComponent(g, c, c.getParent(),                                       getCellBounds(x, y, node));      }	}