java.applet
public class Applet extends Panel
To be useful, a subclass should override at least start(). Also useful are init, stop, and destroy for control purposes, and getAppletInfo and getParameterInfo for descriptive purposes.
Since: 1.0
UNKNOWN: updated to 1.4
Nested Class Summary | |
---|---|
protected class | Applet.AccessibleApplet
This class provides accessibility support for Applets, and is the
runtime type returned by {@link #getAccessibleContext()}.
|
Constructor Summary | |
---|---|
Applet()
Default constructor for subclasses.
|
Method Summary | |
---|---|
void | destroy()
This method is called when the applet is being unloaded. |
AccessibleContext | getAccessibleContext()
Gets the AccessibleContext associated with this applet, creating one if
necessary. |
AppletContext | getAppletContext()
Returns the applet context for this applet.
|
String | getAppletInfo()
Returns a descriptive string with applet defined information. |
AudioClip | getAudioClip(URL url)
Returns an audio clip from the specified URL. |
AudioClip | getAudioClip(URL url, String name)
Returns an audio clip from the specified absolute URL, and relative path
from that URL. |
URL | getCodeBase()
Returns the URL of the code base for this applet.
|
URL | getDocumentBase()
Returns the basename URL of the document this applet is embedded in. |
Image | getImage(URL url)
Returns an image from the specified URL. |
Image | getImage(URL url, String name)
Returns an image from the specified absolute URL, and relative path
from that URL. |
Locale | getLocale()
Returns the locale for this applet, if it has been set. |
String | getParameter(String name)
Returns the value of the specified parameter that was specified in
the <APPLET> tag for this applet.
|
String[][] | getParameterInfo()
Returns a list of parameters this applet supports. |
void | init()
This method is called when the applet is first loaded, before start().
|
boolean | isActive()
Tests whether or not this applet is currently active. |
static AudioClip | newAudioClip(URL url)
Returns an audio clip from the specified URL. |
void | play(URL url)
Loads and plays the audio clip pointed to by the specified URL. |
void | play(URL url, String name)
Loads and plays the audio clip pointed to by the specified absolute URL,
and relative path from that URL. |
void | resize(int width, int height)
Requests that the applet window for this applet be resized.
|
void | resize(Dimension dim)
Requests that the applet window for this applet be resized.
|
void | setStub(AppletStub stub)
The browser calls this method to set the applet's stub, which is the
low level interface to the browser. |
void | showStatus(String message)
Displays the specified message in the status window if that window
exists.
|
void | start()
This method is called when the applet should start running. |
void | stop()
This method is called when the applet should stop running. |
Throws: HeadlessException if in a headless environment
Returns: the accessibility context of this applet
Since: 1.3
Returns: the applet context for this applet
null
, so subclasses
must override to return information.
Returns: a string describing the author, version, and applet copyright
Parameters: url the URL of the audio clip
Returns: the retrieved audio clip
Throws: NullPointerException if url is null
getAudioClip(new URL(url, name))
, but if building
the new URL fails, this returns null.
Parameters: url the base URL of the audio clip name the name of the clip relative to the URL
Returns: the retrieved audio clip, or null on failure
See Also: getAudioClip
Returns: the URL of the code base for this applet
Returns: the URL of the document this applet is embedded in
See Also: getCodeBase
Parameters: url the URL of the image
Returns: the retrieved image
Throws: NullPointerException if url is null
getImage(new URL(url, name))
, but if building
the new URL fails, this returns null.
Parameters: url the base URL of the image name the name of the image relative to the URL
Returns: the retrieved image, or null on failure
See Also: getImage
Returns: the locale for this applet
Since: 1.1
See Also: setLocale
<APPLET>
tag for this applet.
Parameters: name the parameter name
Returns: the parameter value, or null if the parameter does not exist
Throws: NullPointerException if name is null
Returns: the list of parameters supported by this applet
Returns: true
if this applet is active
Parameters: url the URL of the audio clip
Returns: the retrieved audio clip
Throws: NullPointerException if url is null
Since: 1.2
See Also: getAudioClip
Parameters: url the URL of the audio clip
Throws: NullPointerException if url is null
See Also: getAudioClip
Parameters: url the base URL of the audio clip name the name of the audio clip relative to the URL
Parameters: width the new width in pixels height the new height in pixels
Parameters: dim the requested dimensions
Throws: NullPointerException if dim is null
Parameters: stub the applet stub for this applet
Parameters: message the status message, may be null