Download the JDK
Search the Tutorials
Hide the TOC
Trail: Deployment
Lesson: Applets
Section: Taking Advantage of the Applet API
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
« Previous • Trail • Next »
Defining and Using Applet Parameters

> Parameters are to applets what command-line arguments are to applications. They allow the user to customize the applet's operation. By defining parameters, you can increase your applet's flexibility, making your applet work in multiple situations without recoding and recompiling it.

> The next few pages discuss parameters from the applet programmer's point of view. To learn about the user view of parameters, see Specifiying Parameters.

### Deciding Which Parameters to Support

> When implementing parameters, you must answer four questions:

> - What should the applet let the user configure?
> - What should the parameters be named?
> - What kind of value should each parameter take?
> - What should the default value of each parameter be?

### Writing the Code to Support Parameters

> Applets get the user-defined values of parameters by calling the `Applet` `getParameter` method.

### Giving Information about Parameters

> By implementing the `getParameterInfo` method, applets provide information that browsers can use to help the user set parameter values.

« Previous • Trail • Next »
Previous page: Playing Sounds
Next page: Deciding Which Parameters to Support