g.drawImage(buffer, 0, 0, this);
rm.commitBuffer(root, new Rectangle(translation.x + r.x, translation.y + r.y, r.width, r.height));
  void paintDoubleBuffered(Graphics g)  {        Rectangle r = g.getClipBounds();    if (r == null)      r = new Rectangle(0, 0, getWidth(), getHeight());    RepaintManager rm = RepaintManager.currentManager(this);    // Paint on the offscreen buffer.        Image buffer = rm.getOffscreenBuffer(this, getWidth(), getHeight());        Graphics g2 = buffer.getGraphics();        g2 = getComponentGraphics(g2);        g2.setClip(r.x, r.y, r.width, r.height);        isPaintingDoubleBuffered = true;    try      {        paint(g2);      }    finally      {        isPaintingDoubleBuffered = false;        g2.dispose();      }        // Paint the buffer contents on screen.        g.drawImage(buffer, 0, 0, this);      }