Lesson: Java Applets (The Java™ Tutorials > Deployment)

Download Ebooks
Download JDK
Search Java Tutorials
Hide TOC
Java Applets
Getting Started With Applets
Defining an Applet Subclass
Methods for Milestones
Life Cycle of an Applet
Applet's Execution Environment
Developing an Applet
Deploying an Applet
Deploying With the Applet Tag
Doing More With Applets
Finding and Loading Data Files
Defining and Using Applet Parameters
Displaying Short Status Strings
Displaying Documents in the Browser
Invoking JavaScript Code From an Applet
Invoking Applet Methods From JavaScript Code
Handling Initialization Status With Event Handlers
Manipulating DOM of Applet's Web Page
Displaying a Customized Loading Progress Indicator
Writing Diagnostics to Standard Output and Error Streams
Developing Draggable Applets
Communicating With Other Applets
Working With a Server-Side Application
Network Client Applet Example
What Applets Can and Cannot Do
Solving Common Applet Problems
Questions and Exercises
Trail: Deployment
« Previous • Trail • Next »

# Lesson: Java Applets

This lesson discusses the basics of Java applets, how to develop applets that interact richly with their environment, and how to deploy applets.

A Java applet is a special kind of Java program that a browser enabled with Java technology can download from the internet and run. An applet is typically embedded inside a web page and runs in the context of a browser. An applet must be a subclass of the `java.applet.Applet` class. The `Applet` class provides the standard interface between the applet and the browser environment.

Swing provides a special subclass of the `Applet` class called `javax.swing.JApplet`. The `JApplet` class should be used for all applets that use Swing components to construct their graphical user interfaces (GUIs).

The browser's Java Plug-in software manages the lifecycle of an applet.

Note: Some features of Java applets may not work as described on Mac OS. This is because of the way the Java Plug-in software interfaces with browsers on Mac OS.

Note:

Please make sure you have at least Java SE Development Kit (JDK) 6 update 10 release on your client machine before proceeding further. You will need this to view the sample rich internet applications and read subsequent sections without interruptions.

« Previous • Trail • Next »

Problems with the examples? Try Compiling and Running the Examples: FAQs.
Complaints? Compliments? Suggestions? Give us your feedback.

Previous page: Table of Contents
Next page: Getting Started With Applets