Setting Up an HTML Page

HTML (the hypertext markup language) is the language used on the World Wide Web. It is a collection of platform-independent styles that are indicated by markup tags to define different components of a WWW document.

In order for a Java applet to run, it must be inside an HTML page. This page will supply you with enough bare bones information about HTML to insert Java applets into your document and run them in your Java capable browser.

HTML documents can be created using any text editor and should be saved as text with an html (or htm in DOS) extension. For example, save as webpge.html will save your text file with the extension .html which then can be viewed by a browser such as Netscape, Microsoft Internet Explorer, or Mosaic.

The fundamental component of the structure of an HTML document is an element. Elements include heads, tables, paragraphs, and lists. HTML is not case-sensitive except for a few special symbols.

A bare bones HTML document will be needed in order for your Java applet to run. The head contains the title and the body contains the text which can consist of paragraphs, lists, java applets, graphics in gif or jpg format, and other elements. The required tags are shown below.

<html>
<head>
<TITLE>An Example of a Bare Bones HTML document</TITLE>
</head>
<body>
<h1>HTML is needed to be able to run your Java applets</h1>
<p>This is where your paragraph will be typed. It will continue to wrap around until you tag the end of it</p>
<p>A second paragraph would go here</p>
</body>
</html>

These tags are the minimum required so you may want to create a template file with them. Do not leave out any of these tags. Even if your browser can read the document when you leave tags out, other browsers may not be able to do so unless you follow the strict HTML format.

The basic HTML document listed above is all that is needed to place a Java applet on your page. You may wish to learn how to place Java applets on a Web Page next or continue to learn more about HTML. Or perhaps you are particularly interested in How to Create a Personal Web Page.

Go to the next topic: Placing Java Applets on a Web Page

Back to the Table of Contents