Component root = SwingUtilities.getRoot(component);
Component root = getRoot(component);
  public Image getOffscreenBuffer(Component component, int proposedWidth,                                  int proposedHeight)  {    Component root = SwingUtilities.getRoot(component);    Image buffer = (Image) offscreenBuffers.get(root);    if (buffer == null         || buffer.getWidth(null) < proposedWidth         || buffer.getHeight(null) < proposedHeight)      {        int width = Math.max(proposedWidth, root.getWidth());        width = Math.min(doubleBufferMaximumSize.width, width);        int height = Math.max(proposedHeight, root.getHeight());        height = Math.min(doubleBufferMaximumSize.height, height);        buffer = component.createImage(width, height);        offscreenBuffers.put(root, buffer);      }    return buffer;  }