Hi everybody,
I am developing standalone application using NetBeans,the aplication is running fine in netbeans IDE but not when Jar alone tried to run.I kept all the files related to application with the jar.
when running jar,the app is running fine upto some extent,and throwing exception at the time of fetching images from images folder which is placed inside "src folder"
class files package and images folder are in the src folder. the code is like this:
mLogo = new JLabel();
URL lUrlLogo = getClass().getResource("/images/eaze.gif");
System.out.print(lUrlLogo);
Image lLogoimage = Toolkit.getDefaultToolkit().createImage(lUrlLogo);//.getImage(lUrlLogo);
ImageIcon licon = new ImageIcon(lLogoimage);
mLogo.setIcon(licon);
i tried by using Mainclass.class.getResource("/images/eaze.gif");
and also by using thread but dint solved
The exception is like this:
Uncaught error fetching image:
java.lang.NullPointerException
at sun.awt.image.URLImageSource.getConnection(URLImageSource.java:99)
at sun.awt.image.URLImageSource.getDecoder(URLImageSource.java:113)
at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:240)
at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:172)
at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136)