Running Swing Applets
Problem?
If you're developing Java now, chances are you're using Swing. If someone's using an old browser, chances are your applet won't run. Typically if you wanted to have an applet run in your webpage the code you'd use would look something like this.
<APPLET code="foo.class" codebase="html/" align="baseline"
width="200" height="200">
<PARAM NAME="model" VALUE="models/HyaluronicAcid.xyz">
No Java 2 SDK, Standard Edition v 1.3 support for APPLET!!
</APPLET>
When your browser hits the <APPLET> tag it starts up the browsers JVM (Java Virtual Machine), but if the person viewing the web page has an old browser, it's unlikely their JVM will support Swing so they won't be able to view your applet.
Solution?
The JRE1.3 (Java Runtime Environment 1.3) comes with the Java Plug-In. Using the Java Plug-In, any browser, no matter how old should be able to run your applet. But because your browser will invoke the default JVM when it hits the <APPLET> tag, to call the Plug-In the <OBJECT> tag is used instead.
The HTML code for using the <OBJECT> tag looks a lot more complicated:
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="200" height="200" align="baseline"
codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">
<PARAM NAME="code" VALUE="foo.class">
<PARAM NAME="codebase" VALUE="html/">
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
<PARAM NAME="model" VALUE="models/HyaluronicAcid.xyz">
<PARAM NAME="scriptable" VALUE="true">
No Java 2 SDK, Standard Edition v 1.3 support for APPLET!!
</OBJECT>
Fortunatley, this isn't a problem. The HTML Converter which can be downloaded from
java.sun.com will sort out all your worries. Run the HTML converter, select the folder and it will automatically convert any HTML files so that they'll invoke the Plug-In.
Anything else I should know?