posted 18 years ago
I've looked around and read some stuff but I'm still confused on how to get my Jar file to be self-contained. I'm using Eclipse with separate Source and Class folders. I use about 40 different images while running my program and they're all in different folders.
I've tried:
getClass().getResource("Images/character.gif")
I've also read about some ClassLoader you can use to get a similar effect:
ClassLoader cldr = this.getClass().getClassLoader();
ImageIcon area2 = cldr.getResource("Maps/area2.png");
Neither of these seem to work. I've tried putting all the files in the source and bin folders. Regardless of all of this I still can't seem to get it to work properly. The Jar's just won't function without those folders near them even though I include the folders & files in the jar when I create it.
What do I need to do to get this to work?