★ wanayoo — archive 1999 http://java.sun.com/openstudio/guide.htmlNouvelle recherche | Portail wanayoo
Java Technology Home Page
Downloads, APIs, Documentation
Java Developer Connection
Docs, Tutorials, Tech Articles, Training
Online Support
Community Discussion
News & Events from Everywhere
Products from Everywhere
How Java Technology is Used Worldwide

A-Z Index

The Source for Java Technology

ADDING JAVATM TECHNOLOGY-ENABLED APPLETS
TO YOUR PAGE

Open Studio | Freebie Applets | Resources
What Is JavaTM | Tutorial | Java Developer ConnectionSM

Adding applets enabled with JavaTM technology to your site is much like adding images. The page on which you wish to present the applet needs to reference the location of the applet code. Applet code filenames end with .class . You must include the following HTML code in a web page to load an applet named xxx:

<APPLET CODE="xxx.class" WIDTH="100" HEIGHT="100">
</APPLET>

Referencing the above syntax, the xxx.class must be located in the same directory as the HTML file which is calling it.

You may also load .class files that are in different directories than the HTML file. To do this you need to add the CODEBASE attribute to the APPLET tag. The example below would load the applet named xxx.class from the subdirectory applets:

<APPLET CODE="xxx.class" CODEBASE="applets" WIDTH="100" HEIGHT="100">
</APPLET>

Some applets offer the webmaster the freedom to change certain parameters which affect the behavior of the applet. An example of an applet which takes parameters:

<APPLET CODE="xxx.class" WIDTH="100" HEIGHT="100">
<PARAM NAME=backGroundColor VALUE="FFFF00">
</APPLET>

NOTE: all file names are case sensitive. Whenever an applet fails to load or reports that it cannot locate a graphic or a class file, the first thing to check is that the names match exactly.

Download one of our freebie applets now!

For a more complete description of all the possible applet parameters see:

If you have any suggestions or comments regarding the contents of this page, we welcome your feedback.


[ This page was updated: 25-Feb-00 ]

Products & APIs | Developer Connection | Docs & Training | Support
Community Discussion | Industry News | Solutions Marketplace | Case Studies
Glossary - Applets - Tutorial - Employment - Business & Licensing - Java Store - Java in the Real World
Feedback | Map | A-Z Index

For more information on Java technology
and other software from Sun Microsystems, call:
(800) 786-7638
Outside the U.S. and Canada, dial your country's AT&T Direct Access Number first.
Sun Microsystems, Inc.
Copyright © 1995-2000 Sun Microsystems, Inc.
All Rights Reserved. Terms of Use. Privacy Policy.