Using Java Applets

IMPORTANT: Microsoft and Sun Microsystems introduced several important security changes that cause Java applets not to always work in compiled publications. There is no workaround; that's why Java applets are not officially supported by HTML Executable although they may work.

Java applets are generally not working if they are not run locally or from a server via a HTTP connection. This is due to the way Internet Explorer manages Java applets.

Note that Java applets are extracted temporarily to the user's hard disk! Advanced end users may therefore access to the .class files and easily copy them.

Some recommendations:

  • please use Java applets that only require one class file (a single .class file) or if you have several classes for an applet, try to compress them into a .cab file archive or use a .jar archive (you can use Paquet Builder to create Cabinet archives).
     
  • only real <applet ...> HTML tags should be used. If a cabinet archive or a Jar archive is specified, it must also be compiled into the publication and in the root folder.
     
  • you cannot write a Java applet HTML tag using the document.write javascript command, it will fail.
     
  • the option named "Automatically update Java applet tags..." in the Environment Options must be turned on.
     

Live demonstration:

The following Java applet is a "3D clock":

The HTML code used:

<APPLET CODE="Clock3D.class" WIDTH=200 HEIGHT=200>
<PARAM NAME=fps VALUE=18>
<PARAM NAME=a1 VALUE=12500>
<PARAM NAME=pixd VALUE=29>
<PARAM NAME=pixangle VALUE=5>
<PARAM NAME=radius VALUE=26>
<PARAM NAME=roty VALUE=-4>
<PARAM NAME=rotx VALUE=0>
<PARAM NAME=rotz VALUE=0.401>
<PARAM NAME=irotx VALUE=0>
<PARAM NAME=iroty VALUE=0>
<PARAM NAME=irotz VALUE=00>
<PARAM NAME=style VALUE=1>
<PARAM NAME=color VALUE=#00FF66>
<PARAM NAME=bgcolor VALUE=#000000>
<PARAM NAME=12hour VALUE=0>
</APPLET>

More information about the Java applet at:
http://www.dataway.ch/~bennet/java/3DClock.html