code: public BufferedImage getAsImage() {
          final BufferedImage IMAGE = UTIL.createImage(getWidth(), getHeight(), Transparency.TRANSLUCENT);
          final Graphics2D G2 = IMAGE.createGraphics();
          paintAll(G2);
          G2.dispose();
          return IMAGE;
      }
docs: Returns the current component as buffered image.
  To save this buffered image as png you could use for example:
  File file = new File("image.png");
  ImageIO.write(Image, "png", file);
  @return the current component as buffered image