Reputation: 2613
I have a little Java applet game where you can choose between some themes. It works very well but the downloading time of the huge .jar is not acceptably. Now I want to split the .jar into single .jars, a default one and one for every theme. Now there is just one question: (How) can I read a .jar file from a Java applet which is also a .jar?
Upvotes: 2
Views: 777
Reputation: 168825
(a) For this to work properly, each theme needs to be in a separate package, as well as a separate Jar.
Upvotes: 1
Reputation: 12135
Take a look at the URLClassLoader
. You can give the URL to the theme.jar as a parameter and use the getResource* methods to access the files inside.
Another approach would be to manually download the JAR and open it with the java.util.jar
classes, but I would go with the first approach.
Upvotes: 1