Previous | Next | Trail Map | Writing Applets | Table of Contents


Creating an Applet User Interface

Most applets have a graphical user interface (GUI). This is a natural consequence of the fact that each applet appears (as specified by the <APPLET> tag(in the Writing Applets trail)) within an HTML page that's displayed by a browser. Because the Applet class is a subclass of the AWT (Abstract Window Toolkit) Panel class, and thus participates in the AWT event and drawing model, creating an applet's GUI is just as easy as creating an application's GUI -- easier, actually, since the applet's window (the browser window) already exists.

An applet can mix and match several UI types, depending on the kind of information it needs to give or get. Some applets play sounds, either to give the user feedback or to provide ambiance. Applets can get configuration information from the user through parameters that the applet defines. Applets can get system information by reading system properties. To give text information to the user, an applet can use its GUI or (for text that's not crucial) display a short status string or (for debugging text) display to the standard output or standard error stream.

Some of the UI possibilities mentioned above are available only to applets. Some are available to applications, as well. This lesson gives you everything you need to know to use each UI type in an applet, with pointers to where you can learn more about each non-applet-specific UI option.

Creating a GUI

Applets use the AWT to create their GUIs. Go to this section to learn about the very few issues that apply only to applets that use the AWT.

Playing Sounds

The Applet class and AudioClip interface provide support for playing sounds.

Defining and Using Applet Parameters

You can improve the versatility of your applet by providing parameters.

Reading System Properties

Applets can read some, but not all, system properties.

Displaying Short Status Strings

Applets can display short status strings on the status line of the application in which they're running.

Displaying Diagnostics to the Standard Output and Error Streams

When you're debugging an applet, displaying to the standard output can be an invaluable technique.


Previous | Next | Trail Map | Writing Applets | Table of Contents