Download the JDK
Search the Tutorials
Hide the TOC
Trail: Deployment
Lesson: Applets
Section: Deploying Applets
Applets
Getting Started with Applets
Importing Classes and Packages for Applets
Defining an Applet Subclass
The Life Cycle of an Applet
Methods for Milestones
Methods for Drawing and Event Handling
Methods for Adding UI Components
What Applets Can and Can't Do
Taking Advantage of the Applet API
Finding and Loading Data Files
Displaying Short Status Strings
Displaying Documents in the Browser
Sending Messages to Other Applets
Playing Sounds
Defining and Using Applet Parameters
Deciding Which Parameters to Support
Writing the Code to Support Parameters
Giving Information about Parameters
Using the APPLET Tag
Practical Considerations When Writing Applets
Security Restrictions
Creating a User Interface
Creating a GUI
Displaying Diagnostics to the Standard Output and Error Streams
Getting System Properties
Threads in Applets
Threads in Applets: Examples
Working with a Server-Side Application
A Simple Network Client Applet
Using a Server to Work Around Security Restrictions
Finishing an Applet
Before You Ship that Applet
The Perfectly Finished Applet
Deploying Applets
General Deployment Considerations
Using the applet Tag
Using the object Tag
Using the embed Tag
Deploying Applets in a Mixed-Browser Environment
Solving Common Applet Problems
Questions and Exercises
Home Page > Deployment > Applets
Using the object Tag

> You use the `object` tag to deploy applets that are to be used only with Internet Explorer.

> For complete details on the object tag, read the W3 HTML specification.

> Following is an example of the `object` tag:

>     <OBJECT
>       classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
>       width="200" height="200">
>       <PARAM name="code" value="Applet1.class">
>     </OBJECT>

### The classid Attribute

> The `classid` attribute identifies which version of Java Plug-in to use.

> The example shown below is the most commonly used form of the `classid` attribute. This example instructs Internet Explorer to use the latest installed version of Java Plug-in.

> >     classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"

> Following is an alternative form of the classid attribute:

> >     classid="clsid:CAFEEFAC-xxxx-yyyy-zzzz-ABCDEFFEDCBA"

> In this form, "xxxx", "yyyy", and "zzzz" are four-digit numbers that identify the specific version of Java Plug-in to be used.

> For example, to use Java Plug-in version 1.6.0, you specify:

> >     classid="clsid:CAFEEFAC-0016-0000-0000-ABCDEFFEDCBA"

### The codebase Attribute

> You use the optional `codebase` attribute to specify the location to download JRE from in case it is not installed on the system.

> The codebase attribute has two forms:

> - `codebase=<URL>`

>   With this form, if the JRE specified by the `classid` attribute is not installed locally, then the user is prompted to download the JRE from the URL specified.

> - `codebase=<URL>#Version=major,minor,micro,update`

>   With this form, Java Plug-in compares the `classid` of the locally installed JRE with the required version of JRE, and if the required version is higher, prompts the user to download and install the newer version of the JRE.

> Following is an example of how to use the `codebase` attribute to set up automatic downloads from the Sun Java Web site:

> >     <object
> >       classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
> >       width="200" height="200"
> >       codebase="http://java.sun.com/update/1.6.0/
> >                jinstall-6-windows-i586.cab#Version=6,0,0,99">
> >       <param name="code" value="Applet1.class">
> >     </object>

> > Note: In this example the `codebase=http://java.sun.com ...` line is broken for readability. In the actual HTML file it would be one long line.

> Sun has packaged each version of the JRE installer in Microsoft cabinet (.cab) file format. You can view a list of these releases and the corresponding .cab file names.

Previous page: Using the applet Tag
Next page: Using the embed Tag