code: public void paint (Graphics2D gfx, int x, int y)
      {
          // create our volatile image for the first time if necessary
          if (_image == null) {
              createVolatileImage();
          }
  
  //         int renders = 0;
  //         do {
  //             // validate that our image is compatible with the target GC
  //             switch (_image.validate(_imgr.getGraphicsConfiguration())) {
  //             case VolatileImage.IMAGE_RESTORED:
  //                 refreshVolatileImage(); // need to rerender it
  //                 break;
  //             case VolatileImage.IMAGE_INCOMPATIBLE:
  //                 createVolatileImage(); // need to recreate it
  //                 break;
  //             }
  
  //             // now we can render it
  //             gfx.drawImage(_image, x, y, null);
  //             renders++;
  
  //             // don't try forever
  //         } while (_image.contentsLost() && (renders < 10));
  
          if (IMAGE_DEBUG) {
              gfx.setColor(new Color(_image.getRGB(_bounds.width/2,
                                                   _bounds.height/2)));
              gfx.fillRect(x, y, _bounds.width, _bounds.height);
          } else {
              gfx.drawImage(_image, x, y, null);
          }
  
          // TODO: note number of attempted renders for performance
      }
docs: documentation inherited from interface