User Tools

Site Tools


Sidebar

Translations of this page:

Using Java Applets

IE publications compiled with HTML Executable can contain Java applets, although support for any Java applet is not guaranteed. A Java Virtual Machine is required. For instance, the Java applet below was working with Oracle Java JRE Version 6 Update 27 on Windows 7 x64.

Some guidelines

  • the built-in HTTP server must be enabled in your publication.
  • add the following JavaScript script to your HEAD HTML tag:
myexample.txt
<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 HTTP server.
myexample.txt
<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 Page Dependencies of the HTML page that embeds the Java applets.

Working demonstration

The following Java applet is a “3D clock”:

Example not available in this online documentation: please run the offline help from HTML Executable to have a working example.

The HTML code used:

myexample.txt
<p class="center">
<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></p>

Credit: Bennet Uk

javaapplets.txt · Last modified: 2012/09/14 22:47 (external edit)