• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

What is this error?

 
Greenhorn
Posts: 17
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic