public boolean paint(JComponent paintingComponent,JComponent bufferComponent,Graphics g,int x,int y,int w,int h){
  boolean paintCompleted=false;
  Image offscreen;
  if (repaintManager.useVolatileDoubleBuffer() && (offscreen=getValidImage(repaintManager.getVolatileOffscreenBuffer(bufferComponent,w,h))) != null) {
    VolatileImage vImage=(java.awt.image.VolatileImage)offscreen;
    GraphicsConfiguration gc=bufferComponent.getGraphicsConfiguration();
    for (int i=0; !paintCompleted && i < RepaintManager.VOLATILE_LOOP_MAX; i++) {
      if (vImage.validate(gc) == VolatileImage.IMAGE_INCOMPATIBLE) {
        repaintManager.resetVolatileDoubleBuffer(gc);
        offscreen=repaintManager.getVolatileOffscreenBuffer(bufferComponent,w,h);
        vImage=(java.awt.image.VolatileImage)offscreen;
      }
      paintDoubleBuffered(paintingComponent,vImage,g,x,y,w,h);
      paintCompleted=!vImage.contentsLost();
    }
  }
  if (!paintCompleted && (offscreen=getValidImage(repaintManager.getOffscreenBuffer(bufferComponent,w,h))) != null) {
    paintDoubleBuffered(paintingComponent,offscreen,g,x,y,w,h);
    paintCompleted=true;
  }
  return paintCompleted;
}

public boolean paint ( JComponent paintingComponent , JComponent bufferComponent , Graphics g , int x , int y , int w , int h ) { boolean paintCompleted = false ; Image offscreen ; if ( repaintManager . useVolatileDoubleBuffer ( ) && ( offscreen = getValidImage ( repaintManager . getVolatileOffscreenBuffer ( bufferComponent , w , h ) ) ) != null ) { VolatileImage vImage = ( java . awt . image . VolatileImage ) offscreen ; GraphicsConfiguration gc = bufferComponent . getGraphicsConfiguration ( ) ; for ( int i = 0 ; ! paintCompleted && i < RepaintManager . VOLATILE_LOOP_MAX ; i ++ ) { if ( vImage . validate ( gc ) == VolatileImage . IMAGE_INCOMPATIBLE ) { repaintManager . resetVolatileDoubleBuffer ( gc ) ; offscreen = repaintManager . getVolatileOffscreenBuffer ( bufferComponent , w , h ) ; vImage = ( java . awt . image . VolatileImage ) offscreen ; } paintDoubleBuffered ( paintingComponent , vImage , g , x , y , w , h ) ; paintCompleted = ! vImage . contentsLost ( ) ; } } if ( ! paintCompleted && ( offscreen = getValidImage ( repaintManager . getOffscreenBuffer ( bufferComponent , w , h ) ) ) != null ) { paintDoubleBuffered ( paintingComponent , offscreen , g , x , y , w , h ) ; paintCompleted = true ; } return paintCompleted ; }
paints a region of a component
