Using Java Applets

HTML Executable compiled IE publications can contain Java applets, although support for any Java applet is not guaranteed. A Java Virtual Machine is required.

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

Some guidelines:

  • the built-in HTTP server must be enabled in your publication.

  • add the following JavaScript script to your HEAD HTML tag:

<script type="text/javascript">
window.external.StartInternalServer();
</script> 

  • the codebase attribute of applet tags must be explicitly written with JavaScript in the HTML document. In fact, the codebase should be set to the root path of the built-in server.

 <script type="text/javascript">
var localpath = window.external.GetGlobalVariable('HEBuiltInServerHost', '');
document.write('<applet codebase="' + localpath + '" code="Clock3D.class" align="bottom" width="200" height="200">');
</script>

  • add the CLASS file(s) and any additional file(s) they require to the Dependencies of the HTML page that embeds the Java applets.

Working demonstration

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

The HTML code used:

<script type="text/javascript">
var localpath = window.external.GetGlobalVariable('HEBuiltInServerHost', '');
document.write('<applet codebase="' + localpath + '" code="Clock3D.class" align="bottom" width="200" height="200">');
</script>
<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="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