doubleBuffer = component.createImage(proposedWidth, 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);
  public Image getOffscreenBuffer(Component component, int proposedWidth,                                  int proposedHeight)  {    if (doubleBuffer == null         || (((doubleBuffer.getWidth(null) < proposedWidth)              || (doubleBuffer.getHeight(null) < proposedHeight))            && (proposedWidth < doubleBufferMaximumSize.width)            && (proposedHeight < doubleBufferMaximumSize.height)))      {        doubleBuffer = component.createImage(proposedWidth, proposedHeight);      }    return doubleBuffer;  }