Problem running as JAR
Hai all,
I have an appliaction (JFrame) which run fine when i directly call it using java classname....
But i cant run it as a executable jar file. I am getting the following error message
////////////////////////////////////////////////////////////////////////////////
Uncaught error fetching image:
java.lang.NullPointerException
at sun.awt.image.URLImageSource.getConnection(Unknown Source)
at sun.awt.image.URLImageSource.getDecoder(Unknown Source)
at sun.awt.image.InputStreamImageSource.doFetch(Unknown Source)
at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)
at sun.awt.image.ImageFetcher.run(Unknown Source)
////////////////////////////////////////////////////////////////////////////////
I gave some debug messages and found that excpetion is occuring at the line that call the "show" method of the JFrame. I am trying to load some images in it. I used the following method for it
/////////////////////////////////////////////////////////////
try
{
Image icon=Toolkit.getDefaultToolkit().getImage(this.getClass().getClassLoader().getResource (path+"logo.gif")) ;
this.setIconImage(icon);
}
catch(Exception rt)
{
System.out.println("Error while loading image");
}
/////////////////////////////////////////////////////////////
I hope that the above method is right.
Thanks in advance,
joe

