private static void doSaveImage(BufferedImage image, String fileName) {
      String defaultName = "/Users/eck/Desktop/pentomino_icons/" + fileName + ".png"; // Name for file to be saved.
      File selectedFile = new File(defaultName);
      System.out.println("Saving image " + selectedFile.getAbsolutePath());
      try {
         if ( ! ImageIO.write(image,"PNG",selectedFile) )  // This actually writes the image to the file.
            System.out.println("   Can't write PNG");
      }
      catch (Exception e) {
         System.out.println("   Error while saving image.");
      }
   }