Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials:
 

Software Solutions and Services
 

 
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments
 
The Tag in Detail 
 

In this section you will learn to use the tage.

 

The <APPLET> Tag in Detail

                         


After understanding a simple Java-enabled Web page lets explore the APPLET tag now. The format of this tag is given below:

<APPLET attributes>
applet_parameters
alternate_content
</APPLET> 


<APPLET> Tag Attributes in detail.

The three attributes of this tag are CODE/CODEBASE, WIDTH, and HEIGHT. One another point to note here that when we build <APPLET> tags the words such as APPLET and CODEBASE can be typed in either way as shown. 
The APPLET tag supports a number of standard attributes. The majority of these attributes are nearly identical to the attributes of the IMG tag (to be discussed later in this chapter). The three required attributes are CODE/CODEBASE, WIDTH, and HEIGHT. The following list describes each attribute and its meaning. Bold font indicates something you should type in exactly as shown except that letters don't need to be uppercase. To substitute a value for the word in italics, we use Italic font.
Square brackets indicate that the contents of the brackets are optional. Lets tweak the example below.

< APPLET
[CODEBASE = codebaseURL]
CODE = appletFile 
[ALT = alternateText]
[NAME = appletInstanceName]
WIDTH = pixels
HEIGHT = pixels 
[ALIGN = alignment] 
[VSPACE = pixels]
[HSPACE = pixels]
>
[< PARAM NAME = appletParameter1 VALUE = value >]
[< PARAM NAME = appletParameter2 VALUE = value >]
. . .
[alternateHTML]
</APPLET>


CODEBASE = codebaseURL
This attribute is used to specify the base URL of the applet -- the directory or folder that contains the applet's code. The document's URL is used.

if this attribute is not specified.

CODE = appletFile
This file is relative to the base URL of the applet and it cannot be absolute. This required attribute gives the name of the file that contains the applet's compiled Applet subclass. 

ALT = alternateText
Any text that should be displayed is specified by this optional attribute if the browser understands the APPLET tag but can't run Java applets.

NAME = appletInstanceName
This optional attribute specifies a name for the applet instance. With the help of this attribute it is possible for applets on the same page to find (and communicate with) each other.

WIDTH = pixels
HEIGHT = pixels

The initial width and height (in pixels) of the applet is given by these attributes to display area, not counting any windows or dialogs that the applet brings up.

ALIGN = alignment
This required attribute specifies the alignment of the applet with the same possible values (and have the same effects) as those for the IMG tag: left, right, top, texttop, middle, absmiddle, baseline, bottom, absbottom.

  • left-Aligns the applet at the left margin. The left and right values allow text to flow around the applet. (For spacing around the applet, see the VSPACE and HSPACE attributes.)
  • right-Aligns the applet at the right margin.
  • top-Aligns the applet with the topmost item on the current line in the HTML file.
  • texttop-Aligns the applet with the top of the tallest text in the current line of the HTML file.
  • middle-Aligns the applet with the middle of the baseline of the text in the current line of the HTML file.
  • absmiddle-Aligns the middle of the applet with the middle of the largest item (text or otherwise) in the current line of the HTML file.
  • baseline-Aligns the bottom of the applet with the baseline of the current line of the HTML file.
  • bottom-Equivalent to baseline.
  • absbottom-Aligns the bottom of the applet with the lowest item (text or otherwise) in the current line of the HTML file. 

VSPACE = pixels
HSPACE = pixels
These optional attributes are used to specify the number of pixels above and below the applet (VSPACE) and on each side of the applet (HSPACE). They're used the same way as the IMG tag's VSPACE and HSPACE attributes.

< PARAM NAME = appletParameter1 VALUE = value >
The only way to specify applet-specific parameters is to use the <PARAM> tags. Applets read user-specified values for parameters with the getParameter() method.

alternateHTML
If we use this <applet> tag in an HTML page to be viewed by the browser, probably the browser will ignore the <APPLET> and <PARAM> tags that doesn't understand the <APPLET> tag. Instead of interpreting any other HTML code between the <APPLET> and </APPLET> tags. Java-compatible browsers ignore this extra HTML code.

                         

» View all related tutorials
Related Tags: html c com orm air tags sed char tag rounding ai element tar character elements characters like start call cte

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

2 comments so far (
post your own) View All Comments Latest 10 Comments:

It is very much easy to learn the code through your sites.
Many thanks for the favour received.

Posted by P.RAVICHRISTY on Thursday, 08.7.08 @ 19:42pm | #71609

give me jdbc tutorial

Posted by keshav on Wednesday, 06.18.08 @ 15:49pm | #63720

Training Courses
Tell A Friend
Your Friend Name
Website Designing Services
 
Web Designing Packages From $150!
 
Website Designing Company Web Hosting
 
Website Designing Quotation
 
Search Tutorials:

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.