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 ) { // render cached image g . drawImage ( img , 0 , 0 , null ) ; } else { // render directly paintDirectly ( g , c , w , h , extendedCacheKeys ) ; } }
Paint the component using a cached image if possible .