Getting NullPointerException when i read a image from jar file
Hi All,
I downloaded a jar using webstart and it contains main method and i specified in the resource tag and in a application-desc tag as below.
my jnlp file contains like,
<resources>
<j2se version="1.5+"/>
<jar href="xx.jar" part="client" main="false" download="eager"/>
<jar href="yy.jar" part="client" main="true" download="eager"/>
</resources>
<application-desc main-class="com.Startmain"/>
</application-desc>
It finds the main method in jar file yy.jar and started to execute well. And i am accessing the image which is in jar using getSystemResource() method in
"ClassLoader" class as below,
URL url = ClassLoader.getSystemResource("com/images/" + "logo.gif" );
Image image = Toolkit.getDefaultToolkit().getImage( url );
ImageIcon imageIcon = new ImageIcon( image );
But in getimage(url) method i am getting "java.lang.NullPointerException" but the image present in that path in the jar
as i mentioned.
can anyone help me plese.
Thanks
malert.

