| . Requires a pair of tags. The first tag must have attributes
that identify the class name of the applet and its size in pixels.
The second tag marks the end of the pair. |
| Example: |
| Launching a simple applet |
| |
| Notes: |
| 1. In order to launch the applet, the browser must be Java enabled.
Otherwise, the tags are ignored. |
| |
| 2. The attributes can be coded in any order |
| |
| 3. The CODE= attribute specifies the name of the applet's .class
file (the bytecode file generated by the Java compiler).
If no path is specified, the file is assumed to exist in the
same server directory as the web page. This attribute may optionally
be coded within quotes. For example, CODE="MyApplet.class" |
| |
| 4. The initial pixel width and height of the screen area
used by the applet are specified by the WIDTH= and HEIGHT= attributes.
A call to the resize() method within the applet class can modify
this size. A maximum size of 600 x 400 is recommended for proper
display regardless of the graphics resolution. |
| |
| 5. There are many other attributes for an applet. |
| |
| Notes: |
| 1. The tag is required for each parameter that is passed to an applet. |
| |
| 2. The NAME= attribute specifies the case-sensitive
identifier of the parameter. The VALUE= attribute specifies a
case-sensitive string value associated with the parameter.
It must be coded in quotes if it contains any spaces.
For example, a tag to pass a message to an applet might contain
the attribute VALUE="Hello world!" |
| |
| 3. To retrieve the parameter's value from the browser, the
following expression must be coded within the applet: |
| getParameter("taxRate") |
| |
| In this example, the value received from the browser
would be a String object having the value ".06" |
| |
| 4. There is no restriction on the number of parameters. Simply code a PARAM
tag for each one and place them between the and tags. |