Yes, this is a duplicate of like 100 different posts, but none of the solutions have worked for me.
The way I am defining pictures in my game is this:
frontPage = ImageIO.read(new File("frontpage.png"));
It has worked fine so far, but now, I am exporting it as a jar file and converting it into an exe using Jar2Exe. I have never had a problem with this.
However, to export it and make it readable, I change it to:
frontPage = ImageIO.read(this.getClass().getResource("/frontpage.png"));
I am now getting this error:
java.lang.IllegalArgumentException: input == null!
at javax.imageio.ImageIO.read(Unknown Source)
at com.teamxf.Game.<init>(Game.java:80)
at com.teamxf.Game.main(Game.java:62)
Line 80 is the line above, where I define frontPage.
Line 62 is where I call the constructor in the main method. I define the images in the constructor.
What is causing this issue?
Edit: I am having the same error in eclipse when running it.