GraphicsEnvironment graphicsEnv = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice dev = graphicsEnv.getDefaultScreenDevice(); GraphicsConfiguration conf = dev.getDefaultConfiguration(); Image image = conf.createCompatibleImage(width, height); return image;
Image image = Toolkit.getDefaultToolkit().createImage(prod); return image;
  public Image createImage(int width, int height)  {    GraphicsEnvironment graphicsEnv =      GraphicsEnvironment.getLocalGraphicsEnvironment();    GraphicsDevice dev = graphicsEnv.getDefaultScreenDevice();    GraphicsConfiguration conf = dev.getDefaultConfiguration();    Image image = conf.createCompatibleImage(width, height);    return image;  }