• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Strange NullPointerException at buffImage.getGraphics()

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?
Paper has not yet been outlawed – so let your Java Swing application print with wild abandon: JPDF
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic