sas

Topic: HTML


Using Applet Tag

One of the most exciting recent developments in web technologies is the ability to deliver applications directly to the user's browser, where they are executed on the client machine. These applications are typically small tools--hence the term "applet"--that perform simple tasks on the client computer, including a variety of HTML page display enhancements.

Applets, like client-side image maps, represent a shift in the basic model of web communications. Until recently, servers performed most of the computational work on the Web; client browsers being not much more than glorified terminals. With applets and client-side image maps, Web technology is shifting toward the client, distributing some or all of the computational load from the server to the client and browser.

Applets also represent a way of extending a browser's features without forcing users to purchase or otherwise acquire a new browser, as is the case when developers implement new tag and attribute extensions to HTML. Nor do users have to acquire and install a special application, as is required for helper or plugin applications. This means that once users have a browser that supports applets, you can deliver browser extensions immediately, including HTML display and multimedia innovations

This first method adds the HTML-like tag <APPLET> container tag. Along with the <APPLET> tag is the <PARAM> tag, used to offer certain parameters to the browser concerning the applet (like the speed at which something should display, initialize, and so on). <APPLET> accepts the attributes CODE, CODEBASE, HEIGHT, and WIDTH.

An <APPLET> tag follows the general format:

<APPLET CODEBASE="applet_path_URL" CODE="appletFile.class" WIDTH="number" HEIGHT="number">
<PARAM NAME="attributeName" VALUE="string/number">
...
Alt HTML text for non-Java browsers
</APPLET>

CODEBASE is the path (in URL form) to the directory on your server containing the Java applet. CODE takes the name of the applet. This file always ends in .class, to suggest that it's a compiled Java class. CODE should always be just the filename since CODEBASE is used to find the path to the Java applet.

The WIDTH and HEIGHT attributes accept the number in pixels for the Java applet on your Web page.

An example of the first line of <APPLET> would be the following:

<APPLET CODEBASE="http://www.fakecorp.com/applets/" CODE="clock.class"
HEIGHT="300" WIDTH="300">

<PARAM> is a bit easier to use than it may seem. It essentially creates a variable, assigns a value, and passes it to the Java applet. The applet must be written to understand the parameter's name and value. NAME is used to create the parameter's name; it should be expected by the applet. VALUE is used to assign the value to that particular parameter. It could be a number, bit of text, or even a command that causes the applet to work in a particular way.





Prev