|
Updating Graphics
I was curious about a little problem I was having with updating a Graphics2D in a seperate method from the constructor or main. Pretty much I have a BufferedImage as a private Variable of the class which extends Frame/JFrame, and in the constructor I form it as a new BufferedImage with x and y dimensions.
Now I call upon a method a seperate method, which forms the Graphics2D component from the BufferedImage, and whenever I attempt to draw onto the Graphics2D I get a null pointer exception. Is there something I'm missing here?
|