Class java.applet.Applet
All Packages Class Hierarchy This Package Previous Next Index
Class java.applet.Applet
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----java.applet.Applet
- public class Applet
- extends Panel
Base applet class.
- Applet()
- destroy()
- Cleans up whatever resources are being held.
- getAppletContext()
- Gets a handle to the applet context.
- getAppletInfo()
- Returns a string containing information about
the author, version and copyright of the applet.
- getAudioClip(URL)
- Gets an audio clip.
- getAudioClip(URL, String)
- Gets an audio clip.
- getCodeBase()
- Gets the base URL.
- getDocumentBase()
- Gets the document URL.
- getImage(URL)
- Gets an image given a URL.
- getImage(URL, String)
- Gets an image relative to a URL.
- getParameter(String)
- Gets a parameter of the applet.
- getParameterInfo()
- Returns an array of strings describing the
parameters that are understood by this
applet.
- init()
- Initializes the applet.
- isActive()
- Returns true if the applet is active.
- play(URL)
- Plays an audio clip.
- play(URL, String)
- Plays an audio clip.
- resize(Dimension)
- Requests thatthe applet be resized.
- resize(int, int)
- Requests that the applet be resized.
- setStub(AppletStub)
- Sets the applet stub.
- showStatus(String)
- Shows a status message in the applet's context.
- start()
- Called to start the applet.
- stop()
- Called to stop the applet.
Applet
public Applet()
setStub
public final void setStub(AppletStub stub)
- Sets the applet stub. This is done by automatically by the system.
isActive
public boolean isActive()
- Returns true if the applet is active. An applet is marked active
just before the start method is called.
- See Also:
- start
getDocumentBase
public URL getDocumentBase()
- Gets the document URL. This is the URL of the document in which
the applet is embedded.
- See Also:
- getCodeBase
getCodeBase
public URL getCodeBase()
- Gets the base URL. This is the URL of the applet itself.
- See Also:
- getDocumentBase
getParameter
public String getParameter(String name)
- Gets a parameter of the applet.
getAppletContext
public AppletContext getAppletContext()
- Gets a handle to the applet context. The applet context
lets an applet control the applet's environment which is
usually the browser or the applet viewer.
resize
public void resize(int width,
int height)
- Requests that the applet be resized.
- Overrides:
- resize in class Component
resize
public void resize(Dimension d)
- Requests thatthe applet be resized.
- Overrides:
- resize in class Component
showStatus
public void showStatus(String msg)
- Shows a status message in the applet's context.
getImage
public Image getImage(URL url)
- Gets an image given a URL. Note that this method
always returns an image object immediatly, even if the image does not exist. The actual image data is loaded when it is first needed.
getImage
public Image getImage(URL url,
String name)
- Gets an image relative to a URL. This methods returns
immediately, even if the image does not exist. The actual
image data is loaded when it is first needed.
- See Also:
- getImage
getAudioClip
public AudioClip getAudioClip(URL url)
- Gets an audio clip.
getAudioClip
public AudioClip getAudioClip(URL url,
String name)
- Gets an audio clip.
- See Also:
- getAudioClip
getAppletInfo
public String getAppletInfo()
- Returns a string containing information about
the author, version and copyright of the applet.
getParameterInfo
public String[][] getParameterInfo()
- Returns an array of strings describing the
parameters that are understood by this
applet. The array consists of sets of three strings:
name/type/description. For example:
String pinfo[][] = {
{"fps", "1-10", "frames per second"},
{"repeat", "boolean", "repeat image loop"},
{"imgs", "url", "directory in which the images live"}
};
play
public void play(URL url)
- Plays an audio clip. Nothing happens if the audio clip could
not be found.
play
public void play(URL url,
String name)
- Plays an audio clip. Nothing happens if the audio clip could
not be found.
init
public void init()
- Initializes the applet.
You never need to call this directly, it is called automatically
by the system once the applet is created.
- See Also:
- start, stop, destroy
start
public void start()
- Called to start the applet. You never need to call this method
directly, it is called when the applet's document is visited.
- See Also:
- init, stop, destroy
stop
public void stop()
- Called to stop the applet. It is called when the applet's document is
no longer on the screen. It is guaranteed to be called before destroy()
is called. You never need to call this method directly.
- See Also:
- init, start, destroy
destroy
public void destroy()
- Cleans up whatever resources are being held. If the applet is active
it is stopped stopped.
- See Also:
- init, start, stop
All Packages Class Hierarchy This Package Previous Next Index