Rectangle clip = g.getClipBounds();
Rectangle clip = tree.getVisibleRect();
  int paintControlIcons(Graphics g, int indentation, int descent,                        int childNumber, int depth, JTree tree, TreeModel mod,                        Object node)  {    int h = descent;    int rowHeight = getRowHeight();    TreePath path = new TreePath(getPathToRoot(node, 0));    Icon icon = getCurrentControlIcon(path);        Rectangle clip = g.getClipBounds();    if (indentation > clip.x + clip.width + rightChildIndent        || descent > clip.y + clip.height + getRowHeight())      return descent;    if (mod.isLeaf(node))      descent += rowHeight;    else      {        if (depth > 0 || tree.isRootVisible())          descent += rowHeight;        int max = 0;        if (!mod.isLeaf(node))          max = mod.getChildCount(node);        if (!node.equals(mod.getRoot()))          icon.paintIcon(tree, g, indentation - rightChildIndent - 3, h);                if (tree.isExpanded(path))          {            for (int i = 0; i < max; i++)              {                int indent = indentation + rightChildIndent;                if (depth == 0 && !tree.isRootVisible())                  indent = -1;                descent = paintControlIcons(g, indent, descent, i, depth + 1,                                            tree, mod, mod.getChild(node, i));              }          }      }    return descent;  }