Integrate your applet
You have probably used the following code in some form. In Internet Explorer, IE, you may have noticed the message "Press spacebar / Click to activate" or something similar when using the <applet> tag.
<html>
<head>
<title>Hello world!</title>
</head>
<body>
<applet code="HelloWorld" width="200" height="25">
</applet>
</body>
</html>
Using javascript to bypass the need to activate the applet.
Modify your html code to include a javascript file.
<html>
<head>
<script language="JavaScript" type="text/javascript" src="applet.js">
</script >
<title>Hello world!</title>
</head>
<body>
<script language="javascript" type="text/javascript">
renderAppletObject();
</script>
</body>
</html>
Note the renderAppletObject(). Put this where you want to display the applet. Remember the <script> and </script> tag must inclose the renderAppletObject() method.
The content of the applet.js file.
function renderAppletObject(){
var obHTML = '<applet Code="HelloWorld.class" ';
obHTML += ' width="200" height="25">';
obHTML += '</Applet>';
document.write(obHTML);
}
When the browser has reached the renderAppletObject() in your html file it will write the applet tags and run the applet.
This method also works for flash files, but not with the applet tags of course.