• Post Reply Bookmark Topic Watch Topic
  • New Topic

What is this error?  RSS feed

 
Jake Cirino
Greenhorn
Posts: 17
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im trying to get a class setup so that I can easily import and use a spritesheet, and the code seems like it should work but for some reason im getting an error message.

The code that is testing the new spritesheet:

(No double buffering, I know)

And heres SpriteSheet.java where the error is happening (error points to line 50) Ill leave the javadoc so you guys know what is going on:


and finally, the error:



Tried messing with a few things but i cant seem to figure out whats going on.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Something on that line is null, and there are two candidates: sheet and this.boxdim. My guess is that the image could not be loaded properly. You would have known if you didn't ignore the exception. you should never ever do that; the least you should do is log it (e.g. call e.printStackTrace()).
 
Jake Cirino
Greenhorn
Posts: 17
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:Something on that line is null, and there are two candidates: sheet and this.boxdim. My guess is that the image could not be loaded properly. You would have known if you didn't ignore the exception. You should never ever do that; the least you should do is log it (e.g. call e.printStackTrace()).


Thanks for the reply.

I was using a pathseparator when i should have just been using a separator.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!