Original Post
Hey!
I am currently making a small program in Java that runs in a console window. The program has to create an image and save it to a file. I have the file saving code, and I can create the image. The code I am using to create the image is below:
// Create the image. Applet testMe = new Applet(); Image myBuffer = testMe.createImage(201,201); Graphics bufferG = myBuffer.getGraphics(); bufferG.setColor(Color.black); // ERROR bufferG.fillRect(0,0,201,201); // ERRORHowever, when I run the code, I get a Null Pointer Exception error at the two lines that say there is an error. Can anyone tell me what I am doing wrong? By the way, the whole thing is in a public static void main (String [] args) method. Thanks, Voytek http://www.liquidsoftware.cjb.net Games, apps, and more!