SPONSORED LINKS

Class appWrapper

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--appWrapper

public class appWrapper
extends java.applet.Applet
implements java.applet.AppletStub, java.lang.Runnable

The appWrapper is thought to make the applet itself independent from the original context. This is necessary to be able to detach the applet from the web browsers window without disconnecting it from events. Note: This applet should work with any applet without changes.

<PARAM NAME="applet" VALUE="applet">
Defines the applet to be loaded by the appWrapper. State the applet class name without ".class"!

<PARAM NAME="startButton" VALUE="text">
If this parameter is set the applet is not loaded until the user presses the button. This decreases first time download delay. The text given as value to the parameter is shown on the button. While loading the applet the message "Loading ..." is shown on the button.

<PARAM NAME="stopButton" VALUE="text">
This parameter defines the button text when the applet is loaded. When pressing the button while the applet is running this causes the applet window to be destroyed and the applet is stopped.

<PARAM NAME="frameTitle" VALUE="text">
The frameTitle is the text that is shown in the title bar of the applet window.

Version:
$Id: appWrapper.html,v 1.1.1.1 2005/09/25 22:40:20 rswindell Exp $
Author:
Matthias L. Jugel
See Also:
Serialized Form

Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
appWrapper()
           
 
Method Summary
 void appletResize(int width, int height)
          This method is called when the applet want's to be resized.
 java.lang.String getAppletInfo()
          Give information about the applet.
 java.lang.String[][] getParameterInfo()
          Give information about the appWrapper and the applet loaded.
 boolean handleEvent(java.awt.Event evt)
          Handle button events.
 void init()
          Applet initialization.
 void paint(java.awt.Graphics g)
          Write a message to the applet area.
 void reshape(int x, int y, int w, int h)
          reshape the applet and ourself
 void run()
          Load the applet finally.
 
Methods inherited from class java.applet.Applet
destroy, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, 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, add, addContainerListener, addImpl, 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, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, 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, 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, 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, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, 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

appWrapper

public appWrapper()
Method Detail

init

public void init()
Applet initialization. We load the class giving in parameter "applet" and set the stub corresponding to ours. Thus we are able to give it access to the parameters and any applet specific context.
Overrides:
init in class java.applet.Applet

run

public void run()
Load the applet finally. When using a button this creates a new frame to put the applet in.
Specified by:
run in interface java.lang.Runnable

appletResize

public void appletResize(int width,
                         int height)
This method is called when the applet want's to be resized.
Specified by:
appletResize in interface java.applet.AppletStub
Parameters:
width - the width of the applet
height - the height of the applet

getAppletInfo

public java.lang.String getAppletInfo()
Give information about the applet.
Overrides:
getAppletInfo in class java.applet.Applet

getParameterInfo

public java.lang.String[][] getParameterInfo()
Give information about the appWrapper and the applet loaded.
Overrides:
getParameterInfo in class java.applet.Applet

paint

public void paint(java.awt.Graphics g)
Write a message to the applet area.
Overrides:
paint in class java.awt.Container

reshape

public void reshape(int x,
                    int y,
                    int w,
                    int h)
reshape the applet and ourself
Overrides:
reshape in class java.awt.Component

handleEvent

public boolean handleEvent(java.awt.Event evt)
Handle button events. When pressed it either creates the new applet window or destoys it.
Overrides:
handleEvent in class java.awt.Component