Ø You get access to 243 methods when you use JApplet. The J prefix means it is in javax.
Ø Some of the methods in JApplet are defined in the JApplet class.
Ø The rest are through inheritance from the following classes as described below: Object, Component, Panel, Container, and Applet.
Ø 2 frequently used methods are init and paint. These (and some others take the place of the main method used in applications.
Applet Methods
(22)
|
Source |
Method |
Description |
|
AppletContext |
getAppletContext()
|
Determines this applet's context, which allows the applet to query and affect the environment in which it runs. |
|
java.lang.String |
getAppletInfo() |
Returns information about this applet. |
|
AudioClip |
getAudioClip(java.net.URL url) |
Returns the AudioClip object specified by the URL argument. |
|
AudioClip |
getAudioClip(java.net.URL url, java.lang.String name) |
Returns the AudioClip object specified by the URL and name arguments. |
|
java.net.URL |
getcodeBase() |
Gets the base URL. |
|
java.net.URL |
getDocumentBase() |
Gets the document URL. |
|
java.awt.Image |
getImage(java.net.URL url) |
Returns an Image object that can then be painted on the screen. |
|
java.awt.Image |
getImage(java.net.URL url, java.lang.String name) |
Returns an Image object that can then be painted on the screen. |
|
java.util.Locale |
getLocale() |
Gets the Locale for the applet, if it has been set. |
|
java.lang.String |
getParameter(java.lang.String name) |
Returns the value of the named parameter in the HTML tag. |
|
java.lang.String[][] |
getParameterInfo() |
Returns information about the parameters than are understood by this applet. |
|
|
init() |
Called by the browser or applet viewer to inform this applet that it has been loaded into the system. |
|
boolean |
isActive() |
Determines if this applet is active. |
|
static AudioClip |
newAudioClip(java.net.URL url) |
Get an audio clip from the given URL |
|
void |
play(java.net.URL url) |
Plays the audio clip at the specified absolute URL. |
|
void |
play(java.net.URL url, java.lang.String name) |
Plays the audio clip given the URL and a specifier that is relative to it. |
|
void |
resize(java.awt.Dimension d) |
Requests that this applet be resized. |
|
void |
resize(int width, int height) |
Requests that this applet be resized. |
|
void |
setStub(AppletStub stub) |
Sets this applet's stub. |
|
void |
showStatus(java.lang.String msg) |
Requests that the argument string be displayed in the "status window". |
|
void |
start() |
Called by the browser or applet viewer to inform this applet that it should start its execution. |
|
void |
stop() |
Called by the browser or applet viewer to inform this applet that it should stop its execution. |
Methods inherited from java.awt.Container (51)
add, add, add, add, add, addContainerListener, addImpl
countComponents
deliverEvent, doLayout
findComponentAt, findComponentAt
getAlignmentX, getAlignmentY,
getComponent, getComponentAt, getComponentAt
getComponentCount, getComponents,
getInsets, getLayout, getMaximumSize
getMinimumSize, getPreferredSize
paintComponents, paramString,
preferredSize, print, printComponents
processContainerEvent, processEvent,
remove, remove, removeAll
removeContainerListener,
removeNotify, setCursor, setFont, setLayout
update, validate, validateTree
Methods inherited from java.awt.Component (129)
action, add, addComponentListener,
addFocusListener, addInputMethodListener,
addKeyListener, addMouseListener,
addMouseMotionListener,addPropertyChangeListener, addPropertyChangeListener
bounds
checkImage, checkImage,
coalesceEvents, contains, contains, createImage, createImage
disable, disableEvents,
dispatchEvent
enable, enable, enableEvents,
enableInputMethods
firePropertyChange
getBackground, getBounds, getBounds,
getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont,
getFontMetrics, getForeground, getGraphics, getHeight, getInputContext,
getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName,
getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX,
getY, gotFocus
handleEvent, hasFocus, hide
imageUpdate, inside, isDisplayable,
isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque,
isShowing, isValid, isVisible
keyDown, keyUp
list, list, list, location,
lostFocus
mouseDown, mouseDrag, mouseEnter,
mouseExit, mouseMove, mouseUp, move
nextFocus
paint, paintAll, postEvent, prepareImage,
prepareImage, printAll, processComponentEvent, processFocusEvent,
processInputMethodEvent, processKeyEvent, processMouseEvent,
processMouseMotionEvent
remove, removeComponentListener,
removeFocusListener, removeInputMethodListener, removeKeyListener,
removeMouseListener, removeMouseMotionListener, removePropertyChangeListener,
removePropertyChangeListener, repaint, repaint
repaint, repaint, requestFocus,
reshape
setBackground, setBounds, setBounds,
setComponentOrientation, setDropTarget setEnabled, setForeground, setLocale,
setLocation, setLocation, setName, setSize
setSize, setVisible, show, show,
size
toString, transferFocus
Methods inherited from java.lang.Object (10)
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
JApplet Methods (20)
Called by the constructor methods to create the default rootPane.
Get the AccessibleContext associated with this JApplet
Returns the contentPane object for this applet.
Returns the glassPane object for this applet.
Returns the menubar set on this applet.
Returns the layeredPane object for this applet.
Returns the rootPane object for this applet.
Sets the contentPane property.
Sets the glassPane property.
Sets the menubar for this applet.
Sets the layeredPane property.
By default the layout of this component may not be set, the layout of its contentPane should be set instead.
Sets the rootPane property.
If true then calls to add() and setLayout() will cause an exception to be thrown.
Calls paint (g).