And the following resource loading code with and without the slash '/':

applet.getClass().getResourceAsStream("images/temp/test.png") <- Does not work, Returns null.applet.getClass().getResourceAsStream("/images/temp/test.png") <- Works when I have everything in the same JAR, but not when they are separate. Returns null.

I am splitting up the JARs so the large resources can download separately via JAR Indexing. But, I cannot access this test image with or without indexing when the JARs are separated. Directory structure is:

I'm not sure about applets, but I've used multiple JARs in Java Webstart applications on several occasions. In that case, you just need to list both as resources in your JNLP file, and then directories are preserved.

As far as I know you don't want that leading slash in there, because doing that tells it to go to the root directory and then look from there, rather than the current directory. Have you tried adding on a "user.dir" call?

From what I've read, having no leading slash prepends the class's package name converting all .'s to /'s. I suppose this is useful when you want to load resources that are in subdirectories from your class files, but I have my resources in a separate directory. I tried having no slash and this fails whether I have the files together or in separate JARs.

I haven't tried applet.getCodeBase() + "images/temp/test.png" (is that what you mean by user.dir?) ... maybe I'll give that a shot.. but I don't see how it knows then to open up a JAR and not some resource sitting on a server.

And as I'm sure you know there are no JNLP files for applets =(. Everything I've read seems to imply that getResourceAsStream() should search the full classpath, including both JARs, to look for resources... so I must be doing something wrong here.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org