All Java applets are programs that reside on Web pages. In order to run a Java applet, it is first necessary to have a Web page that references that applet. A Web page is basically made up of text and HTML tags that can be interpreted by a Web browser or an applet viewer. A Web page is also known as HTML page or HTML document. Web pages are stored using a file extension “.html” such as MyApplet.html. Such files are referred to as HTML files. HTML files should be stored in the same directory as the compiled code of the applets.
Web pages include both text that we want to display and HTML tags (commands) to Web browsers. A Web page is marked by an opening HTML tag < HTML> and a closing HTML tag and is divided into the following three major sections:
1. Comment section (Optional)
2. Head section (Optional)
3. Body section
Comment Section: This section contains comments about the Web page. A comment line begins with a . Web browsers will ignore the text enclosed between them. Comments are optional and can be included anywhere in the Web page.
Syntax: …………………. >
Head Section: The head section is defined with a starting tag and a closing tag. This section usually contains a title for the Web page. The text enclosed in the tags
Syntax: ……..
Body Section: After the head section, comes the body section. We call this as body section because this section contains the entire information about the Web page and its behaviour. We can set up many options to indicate how our page must appear on the screen (like colour, location, sound, etc.,). Shown below is a simple body section:
0 comments:
Post a Comment