Quick References
      ADO
      ASP
      CSS2
      HTML
      JavaScript
      Jet SQL
      VBScript
      WML
      WMLScript
      WSH
      XHTML
      XML DOM
      XSLT

Features
      Knowledge Base
      Tutorials

Partners
     ZVON.ORG
     XML
     Planet Source Code
     VisualBuilder
     Web Design
     Your HTML Source
     XML/XSLT Forums
     ASPAlliance
     Scripts
     
     Programmers Heaven
     Tek-Tips Forums
     Developer Fusion
     Code Project









TAG:  applet

<applet> ... </applet>
 
The applet tag is used to download and execute a Java applet. The applet is treated like an image and is rendered into the flow of the text without a line break. You can define the size of the region (the applet window) in which the applet will appear. By using the attributes for applet, style sheets code, and other HTML tags, you can create a presentation and appearance for the applet in the text flow to suit your needs.
 
Java applets can be very slow to load and may not display in many browsers.
 
Many Java applets require that document-specific parameters be provided to control the execution. You can use the param tag, inserted between the opening and closing applet tags, to define these parameters.
 
The applet tag was officially deprecated effective with HTML version 4.0. It was replaced with the object tag. However, this tag in such extensive use on the Internet that it has been resurrected.
 
The closing tag is mandatory.
 
Core Attributes
 
class    id    style    title
 
Attributes
 
align
The align attribute is used to position the applet window with respect to any surrounding text, images, or other applets.
 
alt
The alt attribute provides a text message that will be displayed (in place of the applet) on browsers that cannot display an applet.
 
archive
The archive attribute is a comma-separated list of URLs of Java classes that must be pre-loaded into the local user cache before the applet can be displayed.
 
code
The code attribute is mandatory and specifies the relative URL of the Java class (a .class type file) that must be executed to display the applet. Specifically, the URL is relative to the applet base URL (otherwise the applet will not load).
 
codebase
The codebase attribute is used to specify the URL of the directory where the Java class is stored. If the directory is different from where the HTML code is stored, you must use this attribute.
 
height
The height attribute is used to set the vertical extent of the applet in pixels.
 
hspace
The hspace attribute is used to add additional blank space in pixels to each side of the applet.
 
mayscript
The mayscript attribute is only recognized by Netscape. It permits the applet to access JavaScript code.
 
name
The name attribute is used to assign a unique string of characters as the name of the applet.
 
object
The object attribute is not supported by most browsers. It is the name of a resource where a serialized version of the applet is stored. Do not confuse this attribute with the object tag.
 
vspace
The vspace attribute is used to add additional blank space in pixels both above and below the applet.
 
width
The width attribute is used to set the horizontal extent of the applet in pixels.
 
This example displays a Java applet clock.
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>DevGuru XHTML applet Tag Example</title>
</head>
<body>
<applet codebase="clock/classes/" code="JavaClock.class" width="150" height="150">
<param name="timezone" value="eastern" />
</applet>
</body>
</html>

 
Output:


 


Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information