站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Java Tutorial 5.0 英文版

Taking Advantage of the Applet API - Java Tutorial 5.0 英文版

The JavaTM Tutorial
Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Trail: Deployment
Lesson: Applets

Taking Advantage of the Applet API

The applet API lets you take advantage of the close relationship that applets have with Web browsers. The API is provided by the javax.swing.JApplet class and the java.applet.AppletContext interface.

Applets can use these APIs to do the following:

  • Be notified by the browser of milestones.
  • Load data files specified relative to the URL of the applet or the page in which it is running.
  • Display short status strings.
  • Make the browser display a document.
  • Find other applets running in the same page.
  • Play sounds.
  • Get parameters specified by the user in the <APPLET> tag.

This section discusses each of these topics in turn, except for the milestone methods (init, start, and so on), which are explained in the Methods for Milestones (in the Deployment trail) section. For information about how to use non-applet-specific APIs in an applet, see the Practical Considerations When Writing Applets (in the Deployment trail) section.

Finding and Loading Data Files

This section describes how to load your applet's data files, such as images.

Displaying Short Status Strings

This section describes how to make an applet display a string on the status line of the application in which it is running.

Displaying Documents in the Browser

This section tells you how to use the two showDocument methods to request that the browser visit a particular URL.

Sending Messages to Other Applets

This section provides details and example applets that communicate with each other.

Playing Sounds

The AudioClip interface provides support for playing sounds in applets, as explained and demonstrated in this section.

Defining and Using Applet Parameters

This section describes how to decide which parameters to provide, how to implement them, and how to inform the user about them.

Using the APPLET Tag

This section tells you how to customize an applet by editing its HTML tag.

Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search
Feedback Form

Copyright 1995-2005 Sun Microsystems, Inc. All rights reserved.