src/nl/knokko/gui/testing/GuiTestHelper.java
/**
	 * Creates a random BufferedImage of the given size, writes it to the
	 * destination file and returns it. With 'random', I mean that the red, green,
	 * blue and alpha component of every pixel will be set to a random integer in
	 * the range 0 (inclusive) to 256 (exclusive).
	 * 
	 * @param destination The destination file to where the image should be saved,
	 *                    or null if the image should not be written to disk
	 * @param width       The width of the image to create
	 * @param height      The height of the image to create
	 * @return The created image
	 */
Creates a random BufferedImage of the given size, writes it to the
destination file and returns it. With 'random', I mean that the red, green,
blue and alpha component of every pixel will be set to a random integer in
the range 0 (inclusive) to 256 (exclusive).

@param destination The destination file to where the image should be saved,
or null if the image should not be written to disk
@param width       The width of the image to create
@param height      The height of the image to create
@return The created image
Creates a random BufferedImage of the given size writes it to the destination file and returns it . With ' random ' I mean that the red green blue and alpha component of every pixel will be set to a random integer in the range 0 ( inclusive ) to 256 ( exclusive ) . @param destination The destination file to where the image should be saved or null if the image should not be written to disk @param width The width of the image to create @param height The height of the image to create @return The created image
public BufferedImage createImage(File destination, int width, int height) {
		BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
		Random random = new Random();
		for (int x = 0; x < width; x++) {
			for (int y = 0; y < height; y++) {
				image.setRGB(x, y, new Color(random.nextInt(), false).getRGB());
			}
		}
		if (destination != null) {
			try {
				ImageIO.write(image, "PNG", destination);
			} catch (IOException ioex) {
				throw new TestException("Failed to save image: ", ioex);
			}
		}
		return image;
	}
public BufferedImage createImage ( File destination , int width , int height ) { BufferedImage image = new BufferedImage ( width , height , BufferedImage . TYPE_INT_ARGB ) ; Random random = new Random ( ) ; for ( int x = 0 ; x < width ; x ++ ) { for ( int y = 0 ; y < height ; y ++ ) { image . setRGB ( x , y , new Color ( random . nextInt ( ) , false ) . getRGB ( ) ) ; } } if ( destination != null ) { try { ImageIO . write ( image , "PNG" , destination ) ; } catch ( IOException ioex ) { throw new TestException ( "Failed to save image: " , ioex ) ; } } return image ; }
Creates a random BufferedImage of the given size, writes it to the
 destination file and returns it.
Creates a random BufferedImage of the given size writes it to the destination file and returns it .