How do I place a Java Applet on my Web page?

Java Applets are very easy to apply. But, there are a few considerations to take into account when one is determining to use an applet or not. Who is the typical user? With what speed modem will your typical user be accessing the site? Chances are that unless a user has an overwhelming desire to wait for a Java applet to process, they will proceed with what they have or jump to the next site.

A Java applet is a small Java program that contains executable code. This executable code is compiled and placed in a file called "filename.class". In order to run an applet on your web site you will need to do the following:

  • A filename.class file is needed to run your Java applet. If you download sample applets from the web, you will be given a file with the extension .class.
  • For ease of use, the HTML file(s) and the Java class file(s) should be in one folder.
  • Place the applet code inside the <body> </body> tags of your web page. Caution: Some advanced applets will need to be placed between the <head> </head> tags of your web page. Please read the instructions before applying!

Keep in mind that in many instances, Java is case sensitive. Not using the proper combination of upper and lower case letters may cause problems.

Example Java Applet Code:

<applet code="TickerTape.class" name="Ticker Demo" height="40" width="350">
<param name="string" value="Los Rios Community College District......Frequently Asked Questions." />
<param name="font" value="TimesRoman" />
<param name="fontsize" value="14" />
<param name="style" value="bold" />
<param name="foregroundcolor" value="blue" />
<param name="backgroundcolor" value="white" />
<param name="shadowclassr" value="grey" />
<param name="debug" />

Note: Please visit the links below to retrieve similar sample Java applets.

Links to sample sites of Java applets that can be used on your web site!

Beware: Some users may not have their browser "Java Enabled", this will prevent them from viewing your Java applet!