S
Shelly
I teach Java in High School and we use CodeWarrior as our IDE.
I recently had students run into a problem that I cannot figure out but
I have isolated the problem. They wrote an applet. It runs. When
they add a label and the icon for that label points to a valid image
(using the design view Object Inspector to place it in the label), the
code crashes with a null pointer exception. The stack trace is:
java.lang.NullPointerException
at sun.awt.SunToolkit.getImageFromHash<SunToolkit.java:222>
at sun.awt.SunToolkit.getImage<SunToolkit.java:279>
at ThisApp.initComponents<Thisapp.java:94>
at ThisApp.init<Thisapp.java:82>
at sun.applet.AppletPanel.run<AppletPanel.java:339>
at java.lang.Thread.run<Thread.java:479>
If we remove the image from from the label, then it runs. Note that
this is in the init method and not in the constructor. Also, the code
for this was automatically generated by CodeWarrior and was not
modified by us.
Thanks for any help.
Sheldon
I recently had students run into a problem that I cannot figure out but
I have isolated the problem. They wrote an applet. It runs. When
they add a label and the icon for that label points to a valid image
(using the design view Object Inspector to place it in the label), the
code crashes with a null pointer exception. The stack trace is:
java.lang.NullPointerException
at sun.awt.SunToolkit.getImageFromHash<SunToolkit.java:222>
at sun.awt.SunToolkit.getImage<SunToolkit.java:279>
at ThisApp.initComponents<Thisapp.java:94>
at ThisApp.init<Thisapp.java:82>
at sun.applet.AppletPanel.run<AppletPanel.java:339>
at java.lang.Thread.run<Thread.java:479>
If we remove the image from from the label, then it runs. Note that
this is in the init method and not in the constructor. Also, the code
for this was automatically generated by CodeWarrior and was not
modified by us.
Thanks for any help.
Sheldon