Thank you for visiting Blazing Games

The HTML of Applets

In order to use an applet, a html file containing the applet is needed. Here is a typical html file that can be used. The details of html are beyond the scope of this book, so we will simply focus on the applet tag for the remainder of the chapter.

The applet tag has the following format
<APPLET ARCHIVE="jarfile.jar" CODE="classfile.class" CODEBASE="alternative path" WIDTH=width HEIGHT=height ALIGN=alignment HSPACE=hspace VSPACE=vspace>

ARCHIVE is optional and is used if the applet is stored in a jar file.
CODE is the name of the class file. This should include the full package name of the class.
CODEBASE is an optional parameter that is used to provide a relative path to the root directory where the class files are located.
WIDTH the width of the applet window.
HEIGHT the height of the applet window.
ALIGN optional value describing how the applet is aligned with surrounding text. One of the following values.ABSBOTTOM, ABSMIDDLE, BASELINE, BOTTOM, LEFT, MIDDLE, RIGHT, TEXTTOP
HSPACE is the optional number of pixels horizontally that text will be from the applet.
VSPACE is the optional number of pixels vertically that text will be from the applet.

In addition, as described in an earlier section, there are applet parameters. The format of the param statement is
<PARAM NAME="name" VALUE="value">
with NAME being the name of the parameter, and VALUE being a string value assigned to that parameter.

Previous Chapter 4 Contents Page 10 of 10 Book Contents Next

About - Privacy Policy - Contact - Links - FAQ
Copyright © 2003-2006 Blazing Games Inc. All Rights Reserved