tapestry.support.swing
Class TApplet

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--javax.swing.JApplet
                                |
                                +--tapestry.support.swing.TApplet

public class TApplet
extends javax.swing.JApplet

An applet is a small program that is intended not to be run on its own, but rather to be embedded inside another application.

The Applet class must be the superclass of any applet that is to be embedded in a Web page or viewed by the Java Applet Viewer. The Applet class provides a standard interface between applets and their environment.

One must subclass from an Applet class and can override four Applet methods so that it can respond to major browser events:

init
To initialize the applet each time it's loaded (or reloaded).
start
To start the applet's execution, such as when the applet's loaded or when the user revisits a page that contains the applet.
stop
To stop the applet's execution, such as when the user leaves the applet's page or quits the browser.
destroy
To perform a final cleanup in preparation for unloading.

Not every applet needs to override every one of these methods. Some very simple applets may override none of them.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JApplet
javax.swing.JApplet.AccessibleJApplet
 
Fields inherited from class javax.swing.JApplet
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
TApplet()
          Creates a tapestry applet instance.
 
Method Summary
 java.awt.Component add(java.awt.Component comp)
          Adds the specified component to this container replacing the current component within it.
 java.awt.Rectangle getBounds()
          Returns the applet's boundaries as a rectangle, i.e., upper-left corner (x, y) and dimensions (width, height).
 TCanvas getCanvas()
          Gets the TCanvas within this container.
static TApplet getInstance()
          Returns the single instance of the TApplet.
 void init()
           
 void remove(java.awt.Component comp)
          Removes the specified component from this container.
 void setLayout(java.awt.LayoutManager mgr)
          Sets the layout manager for this container, i.e., how components are arranged within this container.
 
Methods inherited from class javax.swing.JApplet
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.applet.Applet
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setFont, validate, validateTree
 
Methods inherited from class java.awt.Component
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, 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, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TApplet

public TApplet()
Creates a tapestry applet instance.
Method Detail

init

public void init()
Overrides:
init in class java.applet.Applet

getInstance

public static TApplet getInstance()
Returns the single instance of the TApplet. Since only one applet is possible within any given program, this allows universal access to the applet.
Returns:
the one instance of the applet

getCanvas

public TCanvas getCanvas()
Gets the TCanvas within this container.
Returns:
the canvas within this container

add

public java.awt.Component add(java.awt.Component comp)
Adds the specified component to this container replacing the current component within it.
Parameters:
comp - component to be added
Returns:
the component argument
Overrides:
add in class java.awt.Container

remove

public void remove(java.awt.Component comp)
Removes the specified component from this container.
Parameters:
comp - component to be removed
Overrides:
remove in class java.awt.Container

setLayout

public void setLayout(java.awt.LayoutManager mgr)
Sets the layout manager for this container, i.e., how components are arranged within this container.
Parameters:
mgr - the specified layout manager
Overrides:
setLayout in class javax.swing.JApplet

getBounds

public java.awt.Rectangle getBounds()
Returns the applet's boundaries as a rectangle, i.e., upper-left corner (x, y) and dimensions (width, height).
Overrides:
getBounds in class java.awt.Component