Hi all, I have developed swings application.In this i have a 3 packages(say 1,2,3). In the 1st package i have written a bean class and ImageIcon classes for loading images and the code snippet is like
<code> URL imageURL = Main.objEmptyClass.getClass().getResource("images/xyrBigImg.gif"); ImageIcon imageIconTempSens_Small = new ImageIcon(imageURL); </code> wherein object objEmptyclass is bean class.
Now my main class is in another 2nd package.I am instantiating the bean class and ImageIcon class also.
Now the problem is,whenn i try to run through netbeans the images are loading.... but when i execute jar file through command line or through doublle clicking on the executable the imageUrl is becoming null.
First of all its just Swing not Swings. As to your problem it is probably because the image resources are in the classpath in NetBeans but not included in the classpath when you are executing the code outside of NetBeans.