private void paintWithCaching(Graphics2D g,JComponent c,int w,int h,Object[] extendedCacheKeys){
  VolatileImage img=getImage(g.getDeviceConfiguration(),c,w,h,extendedCacheKeys);
  if (img != null) {
    g.drawImage(img,0,0,null);
  }
 else {
    paintDirectly(g,c,w,h,extendedCacheKeys);
  }
}

private void paintWithCaching ( Graphics2D g , JComponent c , int w , int h , Object [ ] extendedCacheKeys ) { VolatileImage img = getImage ( g . getDeviceConfiguration ( ) , c , w , h , extendedCacheKeys ) ; if ( img != null ) { g . drawImage ( img , 0 , 0 , null ) ; } else { paintDirectly ( g , c , w , h , extendedCacheKeys ) ; } }
paint the component , using a cached image if possible .
