Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML


 
  
 
Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML
 

 
Facing Programming Problem?
Ask Questions?, Browse Latest Questions, Question-Answer Guidelines
Java
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments

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.

                         

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

Latest Searches:
java.util.Calendar
Junit Eclipse
example of struts with
insert fields blob
multiple ajax combo
ajax on spring
code for Login Applica
ASP Ad Management Rota
crystal reports
Bryce
garbage collection in
struts-blank.war
action:scope=
logical relational ope
callable
jdk-6u1-windows-i586-p
find out factors of nu
Flash Games Location D
Photoshop Cheese Tutor
Action Forms
JTable size
string buffer in java
java list
javascript to display
copying an image from
spring html
how to generate pdf fi
wait
PHP Email Systems Send
excel style sheet
sample examples in spr
java 2d arraylist
add in excel
quiz
?ร??ยà¸????ร??à¸
create and save excel
filename validation re
split
example program of poi
java program to find s
jamaican patoi and eng
Photoshop Drawing Drag
java strings
Calendar
jsf managed bean
display applet message
informatica
Photoshop Effects Clou
sequence number
hibernate examples
microsoft word
validate function in s
point to the start of
icon a JButton
XML XHTML
DOM parsers.
itext pdf generation
jaxp
jpanel borderlayout
Linux Linux and other
Photoshop Photo Effect
how to retain values i
retrieve image from da
Linux Caixa MР Р??Ð
connect SQL server in
java program to transp
spring batch
covert uppercase to lo
f:attribute
multiple submit button
String Tokenizer
java source code for m
NFC RTD
set value to httpsessi
merge sort
breakÑ?â??â??Ñ?????Ñ?â
MULTIPLE SELECT COMBO
how to use date in mys
using check box in dat
different Font
Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

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 | 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.