I'm currently working on my own little video game in Java, but as of now when i give the Runnable Jar file to someone so they can play, i have to send them 22 other resource files which are required, and have them place it in the same folder. This is unbelievably inconvenient and i know that there is a way to automatically package these resources into the runnable jar file. If i cant do this then i would like to at least know how to access the files in the Runnable Jar so i could simply copy paste the files inside. I have combed the internet and no suggestions have worked. I can run the program properly in eclipse if i use this code:
URL url = this.getClass().getResource("Jugger-Nog.jpg");
image = ImageIO.read(new File(filePath));
//image = ImageIO.read(url);
The first line creates a url, which is what i read on many web pages, but using that and the 3rd line of code did not work in the JAR or in Eclipse, but the second line on its own will work just fine in Eclipse. Any ideas, because the internet doesnt have many.