NullPointerException when trying to run an applet of multiple classes

Posted by Chad on Stack Overflow See other posts from Stack Overflow or by Chad
Published on 2009-10-22T20:04:58Z Indexed on 2010/06/09 2:12 UTC
Read the original article Hit count: 251

Filed under:
|

I'm trying to display an applet in an html page. I've had success doing this in the past, but now that I have more than one class in the applet, I seem to get an error every time I try to load the applet in an html page. For a bit, I was writing the html page by hand, but then I realized the applet viewer in netbeans (the IDE I'm coding in) created an html page for you, which is the same as the one I was coding.

The application runs error-free when in the applet viewer, but the following message is displayed when I try to run it in the html page:

java.lang.NullPointerException
at sun.plugin2.applet.Plugin2Manager.findAppletJDKLevel(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.lang.NullPointerException

I tested another small, one class applet and it ran fine in the html page under the same conditions. Any ideas what may be wrong?

© Stack Overflow or respective owner

Related posts about java

Related posts about applet