View Single Post
Old 01-30-2013, 02:43 PM   PM User | #6
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
The error indicates that the ImageIO.read is tossing an IllegalArgumentException in SpriteSheet.load. So the call to SpritSheet.class.getResource(path)) is returning null, which throws an IllegalArgumentException from load, which goes back to the constructor and finally to the static initializer.

Resource loading is not something I'm good with. At all. It always takes me a long time to get it right. Java's a bit confusing since there's two different types, one hinged off of class, and the other hinged off of classLoader. Last time I did this, I'm pretty sure I simply gave it an absolute path from the class path using /path/to/image nested in that structure from the project root, and then loaded it using MyClass.class.getClassLoader().getResource(thatpath). But looks to me that the only problem you have is the loading of the image resource itself.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote