I’ve been using the loadImage (uses Imageio.read(getClass().getResource()) class from the wiki in my java projects lately. I’d been loading images in a jar from an app inside a jar with no problems.
Now I’m working with an applet inside a jar. The jar contains the applet, some misc class files, an image file (.gif), and another jar. The manifest only has ClassPath defined for the jar in the jar. The applet loads and runs fine except the images are smeared.
It makes me think that the getClass.getResource isn’t recognizing the image is in a jar when in fact it is.
The file structure in the jar looks like this:
Manifest.mf
js.jar
applet.class
misc.class
misc.class
image.gif
I hate to go thru the trouble of opening a url connection to a jar file if I don’t have too? I shouldn’t have to, should I?
