I am currently working on a relatively simple Java application that uses Swing for its GUI. As such, there are several image files that it needs to load for icons etc. There are also a few text files that it might need to read for help files.
Ideally, the entire application, including all of the picture/text files, will be packaged into a single JAR file. At runtime, the application would be able to load the required files out of the JAR file.
Now, I'm not sure if there is a simple solution to this. If there is, please share because my googling hasn't given me much success.
Alternatively, I suppose what the program needs to do is find the JAR file that is being loaded from - this in itself is not an easy task because the working directory may not always be the same as the directory with the JAR in it. After finding the JAR file, I figure I can use the JAR API included with Java to pull the required files out and load them up.
Any help would be greatly appreciated. Thanks.