I made a program in Netbeans using the GUI builder and there it was running fine but when I copied the source code from Netbeans and pasted in Eclipse I am getting the following error.
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at javax.swing.ImageIcon.<init>(ImageIcon.java:205)
at frame2.initComponents(frame2.java:100)
at frame2.<init>(frame2.java:17)
at frame2$5.run(frame2.java:671)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
I searched it on net and found that I might had not initialized something which caused this exception. So here are the questions :-
1) If there is any exception why the program is running fine in Netbeans?
2) and how could I make this code run on Eclipse?
here is the link of my code:
And I had putted the image on the right place.
frame2.javaline 100, you probably passnullto theImageIconconstructor.