code: public static BufferedImage convertTo(JComponent comp, BufferedImage storage) {
  		if (storage == null)
  			storage = new BufferedImage(comp.getWidth(), comp.getHeight(), BufferedImage.TYPE_INT_RGB);
  
  		Graphics2D g2 = storage.createGraphics();
  
  		comp.paintComponents(g2);
  
  		return storage;
  	}
docs: Draws the component into a BufferedImage.
  
  @param comp	The component being drawn into an image.
  @param storage if not null the component is drawn into it, if null a new BufferedImage is created.
  @return image of the component