I know I asked to close this request but it keeps failing to get the image from the classpath (from the applet loader jar) to me in some cases...
Right now, whenever I test the Applet Loader, I have to copy the images to the place where the codebase is pointing at, for example, where the game is, so the applet loader is downloading 2 times each image (once when the applet loader jar is downloaded, and once when they are loaded using getImage()).
what do you say about some thing like this:
URL url = Thread.currentThread().getContextClassLoader().getResource("/"+s);
// check without the "/"
if (url == null)
AppletLoader.class.getClassLaoder().getResource(s);
// if image not found in jar, look outside it
if (url == null) {
url = new URL(getCodeBase(), s);
}
I don't like the solution too much, but it a way to maintain the bug fix you said and also look in the AppletLoader class path (where the images are).