Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Strange NullPointerException at buffImage.getGraphics()  RSS feed

martin chile
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?
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!