Rectangle bounds = children[i].getBounds();
Rectangle bounds = children[i].getBounds(rectCache);
  protected void paintChildren(Graphics g)  {    Shape originalClip = g.getClip();    Rectangle inner = SwingUtilities.calculateInnerArea(this, new Rectangle());    g.clipRect(inner.x, inner.y, inner.width, inner.height);    Component[] children = getComponents();    for (int i = children.length - 1; i >= 0; --i)      {        if (!children[i].isVisible())          continue;        Rectangle bounds = children[i].getBounds();        Rectangle oldClip = g.getClipBounds();        if (oldClip == null)          oldClip = bounds;        Rectangle clip = oldClip.intersection(bounds);        if (clip.isEmpty())          continue;        boolean translated = false;        try          {            g.setClip(clip.x, clip.y, clip.width, clip.height);            g.translate(bounds.x, bounds.y);            translated = true;            children[i].paint(g);          }        finally          {            if (translated)              g.translate(-bounds.x, -bounds.y);            g.setClip(oldClip);          }      }    g.setClip(originalClip);  }