View Single Post
  #1 (permalink)  
Old 07-20-2007, 05:23 AM
Greedful Greedful is offline
Member
 
Join Date: Jul 2007
Posts: 2
Greedful is on a distinguished road
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?
Reply With Quote
Sponsored Links