Applet does not run : Error java.lang.reflect.InvocationTargetException

Hi,

I am devloping a drawing application using applet. It was working fine till i changed the directory.

I kept the Project folder inside another folder.

Also made few changes in the variable names of buttons present on the applet.

Now i tried to run it , it gives following error -

run-applet:

java.lang.reflect.InvocationTargetException

at java.awt.EventQueue.invokeAndWait(EventQueue.java:997)

at DrawTool.MainWindow.init(MainWindow.java:43)

at sun.applet.AppletPanel.run(AppletPanel.java:417)

at java.lang.Thread.run(Thread.java:619)

Caused by: java.lang.NullPointerException

at javax.swing.ImageIcon.<init>(ImageIcon.java:138)

at DrawTool.MainWindow.initComponents(MainWindow.java:257)

at DrawTool.MainWindow.access$000(MainWindow.java:23)

at DrawTool.MainWindow$1.run(MainWindow.java:45)

at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)

at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)

at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)

at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)

at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)

at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

Please help,

Thanks

[1568 byte] By [kanchisaa] at [2007-11-26 16:33:02]
# 1
This is the pertinent bit, not the InvocationTargetException itself:Caused by: java.lang.NullPointerExceptionat javax.swing.ImageIcon.<init>(ImageIcon.java:138)Your image resources are no longer in the location where the code is looking for them.
itchyscratchya at 2007-7-8 22:57:41 > top of Java-index,Desktop,Core GUI APIs...
# 2

yes u are right, that error is becoz it didnt find image icon.

Previously ,I had provided images with absolute Image source file.

btn_new.setIcon(new javax.swing.ImageIcon("C:\\\images\\new.gif"));

But now i ve changed it too classpath, for image file.

For the later one it gives that error. I checked my image files are in the same folder called images inside src folder. which i ve given as classpath.

btn_open.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/open.gif")));

It still gives above error, please help.

kanchisaa at 2007-7-8 22:57:41 > top of Java-index,Desktop,Core GUI APIs...