code: public void putImage(String path, int x, int y, int w, int h,
              Graphics2D graphics) {
          ImageIcon i = new ImageIcon(path);
          Image image = i.getImage();
          ImageObserver io = new ImageObserver() {
  
              @Override
              public boolean imageUpdate(Image img, int infoflags, int x, int y,
                      int width, int height) {
                  return false;
              }
          };
  
          graphics.drawImage(image, x, y, w * 3, h * 3, io);
      }
docs: The portrayal of the current device can draw a geometric figure or print
  a predefine image. This method is called when the device has been linked
  to be draw as an image.
  
  @param path
  path to the file that contains the image.
  @param x
  the X position coordinate.
  @param y
  the Y position coordinate.
  @param w
  the wide of the portrayal.
  @param h
  the height of the portrayal.
  @param graphics
  the graphics object to draw the image on.