Unfortunately, the common browsers (Netscape, Internet Explorer) do not
support Java2 -- the most recent version of Java. Java2 is needed to support
the most recent GUI widgets such as JApplet
.
Fortunately, both of these browsers support ways to extend themselves using "plug-ins". With the right magical incantations in the HTML file the browsers will load a plug-in which does support Java2 and the plug-in will run the applet.
The HTML incantations really are magical and it's best to do them automatically with a software tool. Sun provides just such a tool, but it's a bit of a pain to install and use. You have two options: do it the "right" way, or take a short-cut.
When the program runs, it will look something like this:
<!--"CONVERTED_APPLET"--> <!-- CONVERTER VERSION 1.3 --> <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = "500" HEIGHT = "500" codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"> <PARAM NAME = CODE VALUE = "W11.Hangman.ui.HangmanUI" > <PARAM NAME = CODEBASE VALUE = "javaclasses" > <PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> <PARAM NAME="scriptable" VALUE="false"> <COMMENT> <EMBED type="application/x-java-applet;version=1.3" CODE = "W11.Hangman.ui.HangmanUI" CODEBASE = "javaclasses" WIDTH = "500" HEIGHT = "500" scriptable=false pluginspage="http://java.sun.com/products/plugin/1.3/plugin-install.html"> <NOEMBED></COMMENT> </NOEMBED></EMBED> </OBJECT> <!-- <APPLET CODE = "W11.Hangman.ui.HangmanUI" CODEBASE = "javaclasses" WIDTH = "500" HEIGHT = "500"> </APPLET> --> <!--"END_CONVERTED_APPLET"-->
What a pain! Doesn't it make you wish that Netscape and Microsoft could get it together with a common standard?!? One browser that does support Java2 is Opera -- at www.opera.com.
Rather than downloading the HTMLConverter from Sun, installing it and running it, an alternative is to simply cut and paste the code, given above, into your HTML file in place of the existing APPLET tag.
One of the side effects of this conversion is that the AppletViewer finds two tags in the HTML file requesting an applet -- it apparently ignores the fact that the original tag is now inside a comment. The result is that AppletViewer shows two copies of the same applet. Solve this by simply deleting the original applet tag.