BufferedImage, ImageIO and Jar files
Im having a small problem with moving my code over to a Jar file...
What I have at the moment is the following line of code,
In eclipse when I run the project it runs fine, the image is picked up. I have tried exporting the project to a Jar file but the images wont show when I run the jar. I have tried moving the data folder into the Jar file, and also having the jar file and data folder in the same location, but still no luck...
bgImg = ImageIO.read(new File("data/Images/bgImg.png"));
Earlier today I changed the code to this,
but when I compile the code in eclipse I get a
bgImg = ImageIO.read(getClass().getResource("data/Images/bgImg.png"));
What am I missing?
java.lang.IllegalArgumentException: input == null!