Re: spriteSheet wont load?
Quote:
Exception in thread "main" java.lang.IllegalArgumentException: input == null!
at javax.imageio.ImageIO.read(Unknown Source)
at Src.SpriteSheet.BufferedImageLoader.loadImage(Buff eredImageLoader.java:12)
The error says that the input to a method is null. Go to line 12 in BufferedImageLoader and check that the value of the argument to the method called there is not null.
What is the value of the path you are passing the getResource? Is it on the classpath?
Re: spriteSheet wont load?
Code:
public BufferedImage loadImage(String Path) throws IOException {
URL randomStuff = this.getClass().getResource(Path);
BufferedImage img = ImageIO.read(randomStuff);
return img;
}
Error right there...Can't see whats wrong.
Re: spriteSheet wont load?
The error occurs at run time. What is the value of the path variable (lowercase first letter for variables)?
Is it a valid parameter for the getResource() method?
What is the value of randomStuff after the getResource() method is called?
Quote:
.Can't see whats wrong.
Add some printlns to print out the value of the variables to see what is wrong.
Re: spriteSheet wont load?
Re: spriteSheet wont load?
Can you copy and post what is printed on the console?
What variable is null?