Java Reference
In-Depth Information
a forward slash and also is enclosed in angle brackets. The tags enclose
content or other HTML code to define a section of content or apply a color,
style, or other format.
The tag at the beginning and end of the source code for a typical Web page
is an example of an HTML tag. At the beginning of the HTML code for a Web
page, programmers insert the start tag <HTML>. In order to end the code, pro-
grammers need to insert the end tag </HTML>. Figure 2-57 displays the code
for the HTML host document for the WelcomeApplet.
1
<HTML>
2
<APPLET CODE = "WelcomeApplet.class" WIDTH = "400" HEIGHT = "200" >
3
</APPLET>
4
</HTML>
FIGURE 2-57
When an HTML host document is loaded in the browser, the Java applet is
sent to the browser as a separate file. A special HTML tag, <APPLET>…
</APPLET> tells the browser the name of the applet file. In the following series
of steps, you will create a simple HTML file to serve as the host document for
the applet named WelcomeApplet.
To Code an HTML Host Document
1. With the TextPad coding window open, click File on the menu bar.
The File menu is displayed (Figure 2-58).
New command
File menu
FIGURE 2-58
 
Search WWH ::




Custom Search