I’ve been stuck on an annoying problem all morning and I realized I’ve been debugging an inner bug for who knows how long until I realized this outer bug and now I need to re-debug the inner bug… The information available on the net are annoyingly inaccurately varied.
So, I’d appreciate answers to a few simple questions regarding loading resources from within a jar so I can stop hitting my head against the wall:)
Absolute paths are bad. Is there a universal way for both Applets and normal Applications to get at resources from within the same jar?
If not. What are the separate good ways for relatively getting at resources for Applets and Applications?
Consider this scenario:
giraffe.jar \ - Main.class - Applet.class + bin \Game.class \... + resources \Ball.png \GiraffeSprite.jpg \music.wav
In the case of Applets, the html ARCHIVE is set to “giraffes.jar” and CODE to “Applet.class”.
So, whether you load your resources from the Game.class or Applet.class, what’s the perfect line of code to reach the “resources” folder and its godly items?