protected void checkOffscreenImage(Dimension d){
  if (doubleBuffered) {
    if (offscreen == null || offscreen.getWidth() != d.width || offscreen.getHeight() != d.height) {
      offscreen=new BufferedImage(d.width,d.height,BufferedImage.TYPE_INT_ARGB);
      offscreenG2d=offscreen.createGraphics();
    }
  }
}

protected void checkOffscreenImage ( Dimension d ) { if ( doubleBuffered ) { if ( offscreen == null || offscreen . getWidth ( ) != d . width || offscreen . getHeight ( ) != d . height ) { offscreen = new BufferedImage ( d . width , d . height , BufferedImage . TYPE_INT_ARGB ) ; offscreenG2d = offscreen . createGraphics ( ) ; } } }
ensure that , if doublebuffering is enabled , the offscreen image buffer exists and is the correct size .
