Step 1: Creating the HTML


The first step is to create a simple hypertext page with the <APPLET> tag. The tag is a signal to a Java-aware browser to download an applet from a Web server and execute it on a local filesystem.

Below is a simple example of the hypertext page:

 
<HTML> 
<HEAD>
<TITLE>Example</TITLE> 
</HEAD>

<BODY>

<APPLET Codebase =
Code = "Example.class"
Width = "400" 
Height = "200"> 

</APPLET>

</BODY> 
</HTML>

The codebase is the path to directory containing class files. In this case, the compiled Java bytecode is stored in the same directory as the HTML page, so it isn't necessary to specify a path. The code tag is the name of the class file (which is the compiled bytecode). The width tag specifies the width of the applet in pixels, and the height tag specifies the height of the applet in pixels. This is the basic HTML code needed to run an applet on the web.


Send comments and suggestions to jdecarolis@clarku.edu
Last updated 10 October 1997