Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Strange NullPointerException at buffImage.getGraphics()  RSS feed

 
martin chile
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im getting a NullPointerException at a method that is well known and used when displaying graphics.
Im doing like discribed in most books... Im really depressed.
this is the part of the faulty code (common Double-Buffering in JApplet)
Graphics buffGraphics;
Image buffImage;
in init():
buffImage = createImage(500,500);
buffGraphics = buffImage.getGraphics(); <- halt is here
the rest is also like described in books,
update(Graphics g) is overwrited
and so on...
why am i getting a nullpointerexception in the init method??? what could be the problem?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!