Sorry, either your browser doesn't support Java or you are using an operating system that doesn't support long file names, like Windows 3.1.

JAVA - you've probably heard about it. Java is a programming language that was designed to make programming platform independent. In other words, a program written in Java should run under Windows, MAC, Unix, OS/2, etc. equally well. Java is broken up into two sections, a complete program, or Application, that will run on it's own, and a mini-program, or Applet, that is designed to run from within a web browser. Because this is about creating web pages, we will be covering the Applet.

I won't even attempt to show you how to write your own applets. That is well beyond the scope of this tutorial. However, there are hundreds, perhaps thousands of applets available that you can include in your own web page. The applets cover everything from animation, navigation, chat, special effects and games. A lot of the applets available are even free, especially for non-commercial web pages. When you are ready to try including Java applets on your own page, I would recommend starting at java.sun.com. They literally wrote the book on Java (as well as developing it in the first place).

All applets are incorporated into a web page in a similar manner. Most of the applets available on the Internet come with complete instructions on how to add it to your web page and how to change it's appearance to fit your needs. There are two HTML tags that are used with Java Applets.

<APPLET> </APPLET>
The APPLET tag is how you place a Java applet onto a web page. There are a number of attributes, some required and some optional. Optional attributes are shown in italics.
  • CODE= The code is the name of the applet. The names are case sensitive and will end with .class. The applet that provides the wavy text above is "BubelLtr.class".
  • CODEBASE= this optional attribute specifies a URL where the applet can be found. If not included then the browser will look in the same location where the web page was loaded from.
  • NAME= the optional Name attribute allows multiple applets on the same page to communicate with one another if required.
  • ALT= just like an <IMG> tag, the ALT is alternate text to show if the applet can't be executed for some reason. This is not used for browsers that don't support Java.
  • ALIGN= again, used just like an image tag.
  • WIDTH= and HEIGHT= unlike an image tag, the height and width are required for the applet tag. This tells the browser how much space to reserve for the applet. The values are in pixels.
<PARAM>
On most applets you can pass certain parameters to it that will affect how the applet is displayed. These parameters are dependent on the applet being used and will usually be shown in their instructions. A <PARAM> tag has two required attributes.
  • NAME= specifies the name of the parameter you are passing.
  • VALUE= the value for that parameter.

As an example, two of the parameters passed to the applet above are:
<PARAM NAME="text" VALUE="JAVA">
<PARAM NAME=fontsize VALUE="50">

Browsers without Java

If you place any HTML after the last <PARAM> tag, but before the closing </APPLET> tag, this will appear in browsers that do not support Java.

BACK HOME NEXT