I have written a Java program, when it is run I add the name of every image file in the folder "items" into an ArrayList.
This is fine when I am running the application in eclipse. But as soon as I export to a runnable JAR file and run it, the images can't be found and returns a NullPointerException.
I've tried to use getClass().getResource() but to no avail.
This is what my Package Explorer looks like and This is what my exported JAR looks like
As you can see from the second image, all the images are taken out of the items folder and left in the root of the JAR.
Any help would be greatly appreciated!