Hello,
i am trying to load ALL icons i have in my jar file.
i start with:
.....
Class clazz = Class.forName("com.xxx.IconSelectionDialog");
String me = clazz.getName().replace(".", "/") + ".class";
dirURL = clazz.getClassLoader().getResource(me);
if (dirURL.getProtocol().equals("jar")) {
String jarPath = dirURL.getPath().substring(6, dirURL.getPath().indexOf("!")); //strip out only the JAR file
JarFile jar = new JarFile(jarPath );
Enumeration<JarEntry> entries = jar.entries(); //gives ALL entries in jar
while (entries.hasMoreElements()) {
JarEntry nextEntry = entries.nextElement();
String jarEntryName = nextEntry.getName();
.......
.......
}
this works fine while im am debugging from a local jws installation but fails when i start the software with realwebstart from a link.
the error seems to be that the JarFile jar cannot be found even though it has the proper jarPath. can anyone help ?
is there another way to load resources from a jar 8not single named resources, but kind of all *.jpg or similar)
thank you
michael