jars with jnlps

If i call two jars (jar1.jar and jar2.jar) within a jnlp as resources, and i say


java.net.URL imgURL = (class1.class).getResource("icon.gif");

should it not work?
files would be as follows
| jnlp1.jnlp
| jar1.jar

    • class1.class (is the main class)
      | jar2.jar
    • icon.gif

It should work (I usually have my images etc in separate jars as well), however I’d do the following to load your resource:


Thread.currentThread().getContextClassLoader().getResource("icon.gif");