Tuesday, 18 February 2014

THE HTML APPLET TAG

JAVA APPLET TAG IN HTML

The APPLET tag is used to start an applet from both an HTML document and from an applet viewer. An applet viewer will execute each APPLET tag that it finds in a separate window,while web browsers like Netscape Navigator, Internet Explorer, and Hot Java will allow many applets on a single page. So far, we have been using only a simplified form of the APPLET tag. 

The syntax for the standard APPLET tag is shown here. Bracketed items
are optional.

< APPLET
[CODEBASE = codebaseURL]
CODE = appletFile
[ALT = alternateText]
[NAME = appletInstanceName]
WIDTH = pixels HEIGHT = pixels
[ALIGN = alignment]
[VSPACE = pixels] [HSPACE = pixels]
>
[< PARAM NAME = AttributeName VALUE = AttributeValue>]
[< PARAM NAME = AttributeName2 VALUE = AttributeValue>]
. . .
[HTML Displayed in the absence of Java]

</APPLET>


CODEBASE :

CODEBASE is an optional attribute that specifies the base URL of the applet code, which is the directory that will be searched for the applet’s executable class file (specified by the CODE tag). The HTML document’s URL directory is used as the CODEBASE if this attribute is not specified. The CODEBASE does not have to be on the host from which the HTML document was read.

CODE:

CODE  is a required attribute that gives the name of the file containing your applet’s compiled .class file. This file is relative to the code base URL of the applet, which is the directory that the HTML file was in or the directory indicated by CODEBASE if set.

ALT :

The ALT tag is an optional attribute used to specify a short text message that should be displayed if the browser understands the APPLET tag but can’t currently run Java applets. This is distinct from the alternate HTML you provide for browsers that don’t support applets.

NAME: 

NAME is an optional attribute used to specify a name for the applet instance.Applets must be named in order for other applets on the same page to find them by name and communicate with them. To obtain an applet by name, use getApplet( ),which is defined by the AppletContext interface.


WIDTH AND HEIGHT :

WIDTH and HEIGHT are required attributes that give the size (in pixels) of the applet display area.

ALIGN :

ALIGN is an optional attribute that specifies the alignment of the applet.This attribute is treated the same as the HTML IMG tag with these possible values: LEFT, RIGHT, TOP, BOTTOM, MIDDLE, BASELINE, TEXTTOP, ABSMIDDLE,and ABSBOTTOM.

VSPACE AND HSPACE :

These attributes are optional. VSPACE specifies the space,in pixels, above and below the applet. HSPACE specifies the space, in pixels, on each side of the applet. They’re treated the same as the IMG tag’s VSPACE and HSPACE attributes.

PARAM NAME AND VALUE:

The PARAM tag allows you to specify applet specific arguments in an HTML page.Applet access their attributes with the getParameter() method.




1 comment :

  1. It's your birthday again and how I wish I could treat you another boba. Several days ago, I screened our 546 Thermopylae to a class of young film students in Shenzhen, my hometown, and introduced them some basic sound techniques. How I miss working with you on that film, so much fun memories! SAP SCM Tutorial

    ReplyDelete