public void saveImage(String path){
BufferedImage image = (BufferedImage) createImage(500, 500);
Graphics gImage = image.getGraphics(); //<<<<<<<<--- exception
paint(gImage);
image = image.getSubimage(0,0,500,500);
try {
ImageIO.write(image, "png", new File(path+".png"));
}
catch (Exception e){}
}
В чем проблема ??