I have a Swing application that uses some images and icons. When I run it from an exploded directory, everything works fine. But when I run the exact same code from a jar, the ImageIcon objects do not have an image. The images are being found in the JAR (see logging output below) by the call to getResource(), but loading them fails. The code, logging output, and jar structure is shown below.
The code I am using is right out of the
Java Tutorial's
How to Use Icons. And that the tutorial explicitly states that the getResouce() will work for images contained in the application jar file; which it is. But the ImageIcon constructor, which I believe uses MediaTracker behind the scenes, is not loading the image. I really don't know where to go from here. Any help is appreciated.
Logging Output when in exploded directory, and loading image is successful:
Logging Output when in jar, and loading image is unsuccessful:
JAR Structure:
[ May 13, 2008: Message edited by: Mark Vedder ]