img
Method
Description
Applet getApplet(String appletName) Returns the applet specified by appletName if it is within
the current applet context. Other wise, null is returned.
Enumeration<Applet> getApplets( )
Returns an enumeration that contains all of the applets
within the current applet context.
AudioClip getAudioClip(URL url)
Returns an AudioClip object that encapsulates the audio
clip found at the location specified by url.
Image getImage(URL url)
Returns an Image object that encapsulates the image
found at the location specified by url.
InputStream getStream(String key)
Returns the stream linked to key. Keys are linked to
streams by using the setStream( ) method. A null
reference is returned if no stream is linked to key.
Iterator<String> getStreamKeys( )
Returns an iterator for the keys associated with the
invoking object. The keys are linked to streams. See
getStream( ) and setStream( ).
void setStream(String key,
Links the stream specified by strm to the key passed in key.
InputStream strm)
The key is deleted from the invoking object if strm is null.
void showDocument(URL url)
Brings the document at the URL specified by url into view.
This method may not be suppor ted by applet viewers.
void showDocument(URL url,
Brings the document at the URL specified by url into view.
String where)
This method may not be suppor ted by applet viewers. The
placement of the document is specified by where as
described in the text.
void showStatus(String str)
Displays str in the status window.
TABLE 21-2
The Methods Defined by the AppletContext Inter face
The AudioClip Interface
The AudioClip interface defines these methods: play( ) (play a clip from the beginning),
stop( ) (stop playing the clip), and loop( ) (play the loop continuously). After you have
loaded an audio clip using getAudioClip( ), you can use these methods to play it.
The AppletStub Interface
The AppletStub interface provides the means by which an applet and the browser (or applet
viewer) communicate. Your code will not typically implement this interface.
Search WWH :
Custom Search
Previous Page
Java SE 6 Topic Index
Next Page
Java SE 6 Bookmarks
Home