So with ImageIcon, you set up the file location like this - “/textures/Player.png”
However, I can’t figure out how to do this with ImageIO. Something I am missing maybe?
Here’s the code that won’t work (this file is inside of the “res” folder, which is already inside my filesystem. The above ImageIcon example works, and that system is set up like this: res >> textures >> file)
File spriteSheetLocation = new File("/spritesheet.png");
BufferedImage bigImg;
public SpriteSheet(Main main)
{
try {
bigImg = ImageIO.read(spriteSheetLocation);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
And a stack trace
javax.imageio.IIOException: Can’t read input file!
at javax.imageio.ImageIO.read(Unknown Source)
at com.natekramber.main.SpriteSheet.(SpriteSheet.java:19)
at com.natekramber.main.Main.(Main.java:41)
at com.natekramber.main.Main.main(Main.java:169)
I know ra4king promotes ImageIO like crazy, maybe he can help
Thanks a bunch,
-Nathan