java.applet

Class Applet

Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Serializable
Known Direct Subclasses:
JApplet, REDemo

public class Applet
extends Panel

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.

Since:
JDK1.0
See Also:
Serialized Form

Nested Class Summary

protected class
Applet.AccessibleApplet
This class implements accessibility support for the Applet class.

Nested classes/interfaces inherited from class java.awt.Panel

Panel.AccessibleAWTPanel

Nested classes/interfaces inherited from class java.awt.Container

Container.AccessibleAWTContainer

Nested classes/interfaces inherited from class java.awt.Component

Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy

Field Summary

Fields inherited from class java.awt.Component

BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT

Fields inherited from interface java.awt.image.ImageObserver

ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH

Constructor Summary

Applet()
Creates a new Applet object

Method Summary

void
destroy()
Called by the browser or applet viewer to inform this applet that it is being reclaimed and that it should destroy any resources that it has allocated.
AccessibleContext
getAccessibleContext()
Gets the AccessibleContext associated with this Applet.
AppletContext
getAppletContext()
Determines this applet's context, which allows the applet to query and affect the environment in which it runs.
String
getAppletInfo()
Returns information about this applet.
AudioClip
getAudioClip(URL url)
Returns the AudioClip object specified by the URL argument.
AudioClip
getAudioClip(URL url, String name)
Returns the AudioClip object specified by the URL and name arguments.
URL
getCodeBase()
Gets the base URL.
URL
getDocumentBase()
Gets the URL of the document in which this applet is embedded.
Image
getImage(URL url)
Returns an Image object that can then be painted on the screen.
Image
getImage(URL url, String name)
Returns an Image object that can then be painted on the screen.
Locale
getLocale()
Gets the Locale for the applet, if it has been set.
String
getParameter(String name)
Returns the value of the named parameter in the HTML tag.
String[][]
getParameterInfo()
Returns information about the parameters that are understood by this applet.
void
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(URL url)
Get an audio clip from the given URL.
void
play(URL url)
Plays the audio clip at the specified absolute URL.
void
play(URL url, String name)
Plays the audio clip given the URL and a specifier that is relative to it.
void
resize(int width, int height)
Requests that this applet be resized.
void
resize(Dimension d)
Requests that this applet be resized.
void
setStub(AppletStub stub)
Sets this applet's stub.
void
showStatus(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 class java.awt.Panel

addNotify, getAccessibleContext

Methods inherited from class java.awt.Container

Component locate, Dimension minimumSize, Dimension preferredSize, Insets insets, add, add, add, add, add, addContainerListener, addImpl, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, doLayout, extends EventListener> T[] getListeners, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponentZOrder, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, int countComponents, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, list, list, paint, paintComponents, paramString, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree, void deliverEvent, void layout

Methods inherited from class java.awt.Component

Component locate, ComponentPeer getPeer, Dimension minimumSize, Dimension preferredSize, Dimension size, Point location, Rectangle bounds, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, boolean action, boolean gotFocus, boolean handleEvent, boolean inside, boolean isFocusTraversable, boolean keyDown, boolean keyUp, boolean lostFocus, boolean mouseDown, boolean mouseDrag, boolean mouseEnter, boolean mouseExit, boolean mouseMove, boolean mouseUp, boolean postEvent, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, doLayout, enableEvents, enableInputMethods, extends EventListener> T[] getListeners, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, hasFocus, imageUpdate, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusCycleRoot, isFocusOwner, isFocusable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, list, list, list, list, list, paint, paintAll, paramString, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFocusable, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate, void deliverEvent, void disable, void enable, void enable, void hide, void layout, void move, void nextFocus, void reshape, void resize, void resize, void show, void show

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

Applet

public Applet()
            throws HeadlessException
Creates a new Applet object
Throws:
HeadlessException - if GraphicsEnvironment.isHeadless() returns true.
Since:
1.4
Usages and Demos :

View More Examples of Applet()
   1:         {
   2:             new Applet();
   3:             supportsApplet = true;
   4:         ...
   5:         {
   6:             Applet applet = new Applet()
   7:             {
   8:         ...
   9:         {
  10:             return new AppletConfiguration(new Applet());
  11:         }

View Full Code Here
   1:             java.awt.Frame frame = new java.awt.Frame();
   2:         applet = new Applet();
   3:             frame.add(applet);
   4:             frame.addNotify();
   5:                applet.addNotify();

View Full Code Here

Method Details

destroy

public void destroy()
Called by the browser or applet viewer to inform this applet that it is being reclaimed and that it should destroy any resources that it has allocated. The stop method will always be called before destroy.

A subclass of Applet should override this method if it has any operation that it wants to perform before it is destroyed. For example, an applet with threads would use the init method to create the threads and the destroy method to kill them.

The implementation of this method provided by the Applet class does nothing.

See Also:
init(), start(), stop()
Usages and Demos :

View More Examples of destroy()
   1: 
   2: import java.applet.Applet;
   3: import java.net.URL;
   4:         ...
   5: import org.makagiga.commons.*;
   6: import org.makagiga.commons.applet.MApplet;
   7: import org.makagiga.plugins.AbstractPlugin;
   8:         ...
   9:     private boolean started;
  10:     private Applet applet;
  11:     
  12:         ...
  13:         if (applet != null) {
  14:             applet.destroy();

View Full Code Here
   1: import java.applet.*;
   2: import java.awt.*;
   3:         ...
   4:     Graphics g = null;
   5:     Applet applet = null;
   6: 
   7:         ...
   8:         applet.stop();
   9:         applet.destroy();
  10:         applet.removeAll();

View Full Code Here
   1: import java.applet.*;
   2: import java.awt.*;
   3:         ...
   4:     Graphics g = null;
   5:     Applet applet = null;
   6: 
   7:         ...
   8:         applet.stop();
   9:         applet.destroy();
  10:         applet.removeAll();

View Full Code Here
   1: 
   2: package ccs.cpc.applet;
   3: 
   4:         ...
   5: import java.applet.*;
   6: import java.awt.*;
   7:         ...
   8: private boolean isActive;
   9: private Applet applet;
  10: private HashMap<String, String> params;
  11:         ...
  12:     if (isActive) stop();
  13:     applet.destroy();

View Full Code Here
   1: package kaffe.applet;
   2: 
   3:         ...
   4: import java.applet.Applet;
   5:         ...
   6: import java.applet.AppletContext;
   7: import java.applet.AppletStub;
   8:         ...
   9:             app.stop();
  10:             app.destroy();

View Full Code Here

getAccessibleContext

public AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this Applet. For applets, the AccessibleContext takes the form of an AccessibleApplet. A new AccessibleApplet instance is created if necessary.
Specified by:
getAccessibleContext in interface Accessible
Overrides:
getAccessibleContext in interface Panel
Returns:
an AccessibleApplet that serves as the AccessibleContext of this Applet

getAppletContext

public AppletContext getAppletContext()
Determines this applet's context, which allows the applet to query and affect the environment in which it runs.

This environment of an applet represents the document that contains the applet.

Returns:
the applet's context.
Usages and Demos :

View More Examples of getAppletContext()
   1: import java.applet.*;
   2: import java.awt.*;
   3:         ...
   4:     String t;
   5:     URLButton(Applet parent, String t, URL u) {
   6:         super(t);
   7:         ...
   8: 
   9:         parent.getAppletContext().showDocument(u);
  10:     }

View Full Code Here
   1: 
   2: import java.applet.*;
   3: import java.awt.event.*;
   4:         ...
   5: 
   6:     public void appletBrowser(Applet applet, String urlStr, String target) {
   7:         URL url;
   8:         ...
   9:             url = new URL(urlStr);
  10:             applet.getAppletContext().showDocument(url, target);
  11:         }

View Full Code Here
   1: import websphinx.Access;
   2: import java.applet.Applet;
   3:         ...
   4: import java.applet.AppletContext;
   5: 
   6:         ...
   7: 
   8:     static Applet applet;
   9:     static String target;
  10:         ...
  11:     private static void internalSetApplet () {
  12:         context = applet.getAppletContext();

View Full Code Here
   1: package org.rcosjava.software.animator.support;
   2: import java.applet.Applet;
   3: 
   4:         ...
   5:   String[] sAreas;
   6:   Applet theApplet;
   7: 
   8:         ...
   9:       String highlight, String areas[],
  10:       Applet aApplet)
  11:   {
  12:         ...
  13:   {
  14:     theApplet.getAppletContext().showDocument(u);

View Full Code Here
   1: import java.awt.*;
   2: import java.applet.Applet;
   3: import java.awt.event.*;
   4:         ...
   5:   Image sImg;
   6:   Applet theApplet;
   7: 
   8:         ...
   9:                    String highlight, String areas[],
  10:                    Applet aApplet)
  11:   {
  12:         ...
  13:   {
  14:     theApplet.getAppletContext().showDocument(u);

View Full Code Here

getAppletInfo

public String getAppletInfo()
Returns information about this applet. An applet should override this method to return a String containing information about the author, version, and copyright of the applet.

The implementation of this method provided by the Applet class returns null.

Returns:
a string containing information about the author, version, and copyright of the applet.

getAudioClip

public AudioClip getAudioClip(URL url)
Returns the AudioClip object specified by the URL argument.

This method always returns immediately, whether or not the audio clip exists. When this applet attempts to play the audio clip, the data will be loaded.

Parameters:
url - an absolute URL giving the location of the audio clip.
Returns:
the audio clip at the specified URL.
See Also:
AudioClip

getAudioClip

public AudioClip getAudioClip(URL url,
                              String name)
Returns the AudioClip object specified by the URL and name arguments.

This method always returns immediately, whether or not the audio clip exists. When this applet attempts to play the audio clip, the data will be loaded.

Parameters:
url - an absolute URL giving the base location of the audio clip.
name - the location of the audio clip, relative to the url argument.
Returns:
the audio clip at the specified URL.
See Also:
AudioClip
Usages and Demos :

View More Examples of getAudioClip(URL url,String name)
   1: 
   2: import java.applet.*;
   3: import java.net.URL;
   4:         ...
   5: class SoundLoader extends Thread {
   6:     Applet applet;
   7:     SoundList soundList;
   8:         ...
   9:     public void run() {
  10:         AudioClip audioClip = applet.getAudioClip(baseURL, relativeURL);

View Full Code Here
   1: import java.awt.Color;
   2: import java.applet.Applet;
   3:         ...
   4: import java.applet.AudioClip;
   5:         ...
   6: import java.applet.AppletContext;
   7: import java.applet.AppletStub;
   8:         ...
   9:             }
  10:         return(applet.getAudioClip(url, filename));

View Full Code Here

getCodeBase

public URL getCodeBase()
Gets the base URL. This is the URL of the directory which contains this applet.
Returns:
the base URL of the directory which contains this applet.
Usages and Demos :

View More Examples of getCodeBase()
   1: 
   2: import java.applet.Applet;
   3: import java.net.URL;
   4:         ...
   5: 
   6:   private Applet applet;
   7: 
   8:         ...
   9:   public Object getCodebaseURL(){
  10:     if(applet!=null) return applet.getCodeBase();
  11:     return null;

View Full Code Here
   1: package org.xmlBlaster.client.protocol.http.applet;
   2: 
   3:         ...
   4: import java.applet.Applet;
   5: import java.util.Hashtable;
   6:         ...
   7: {
   8:    public XmlBlasterAccessRaw(Applet applet) {
   9:       super(parseAppletParameter(applet, null));
  10:         ...
  11:       if (xmlBlasterServletUrl == null) {
  12:          xmlBlasterServletUrl = applet.getCodeBase() + "AppletServlet";

View Full Code Here
   1: 
   2: import java.applet.Applet;
   3: import java.awt.*;
   4:         ...
   5: 
   6:     public Image a(boolean flag, boolean flag1, String s, Graphics g, Applet applet)
   7:     {
   8:         ...
   9:                 {
  10:                     bufferedinputstream = new BufferedInputStream((new URL(applet.getCodeBase(), s3)).openStream());
  11:                 } else
  12:         ...
  13:             {
  14:                 imageproducer = applet.getImage(applet.getCodeBase(), s).getSource();

View Full Code Here
   1: 
   2: import java.applet.*;
   3: import java.util.*;
   4:         ...
   5: 
   6:     public AlignmentViewer(String[] args, Applet applet) {
   7:         MbgdDataMng mbgdDataMng = MbgdDataMng.Instance();
   8:         ...
   9: 
  10:             URL u = applet.getCodeBase();
  11:             int port = u.getPort();

View Full Code Here
   1: 
   2:     import java.applet.Applet;
   3:         ...
   4:     import java.applet.AppletStub;
   5:         ...
   6:     import java.applet.AppletContext;
   7:     import java.net.URL;
   8:         ...
   9:         if ( this.codeBase != null ) return codeBase;
  10:         else return parentApplet.getCodeBase();

View Full Code Here

getDocumentBase

public URL getDocumentBase()
Gets the URL of the document in which this applet is embedded. For example, suppose an applet is contained within the document:
    http://java.sun.com/products/jdk/1.2/index.html
 
The document base is:
    http://java.sun.com/products/jdk/1.2/index.html
 
Returns:
the URL of the document that contains this applet.
See Also:
getCodeBase()
Usages and Demos :

View More Examples of getDocumentBase()
   1: import java.util.Properties;
   2: import java.applet.Applet;
   3: 
   4:         ...
   5: 
   6:     protected void set_parameters( String[] args, Applet app, Properties props )
   7:     {
   8:         ...
   9:                 if( url!=null ) {
  10:                     base_url_ = new URL(app.getDocumentBase(),url);
  11:                 } else {
  12:         ...
  13:                     base_url_ = app.getDocumentBase();

View Full Code Here
   1: package org.rcosjava.software.animator.support;
   2: import java.applet.Applet;
   3: 
   4:         ...
   5:   String[] sAreas;
   6:   Applet theApplet;
   7: 
   8:         ...
   9:       String highlight, String areas[],
  10:       Applet aApplet)
  11:   {
  12:         ...
  13:   {
  14:     return (theApplet.getDocumentBase());

View Full Code Here
   1: import java.awt.*;
   2: import java.applet.Applet;
   3: import java.awt.event.*;
   4:         ...
   5:   Image sImg;
   6:   Applet theApplet;
   7: 
   8:         ...
   9:                    String highlight, String areas[],
  10:                    Applet aApplet)
  11:   {
  12:         ...
  13:   {
  14:     return (theApplet.getDocumentBase());

View Full Code Here
   1: import java.net.*;
   2: import java.applet.*;
   3: import java.awt.*;
   4:         ...
   5: 
   6:         Applet app=findApplet(c);
   7: 
   8:         ...
   9:         if (app!=null) {
  10:             URL u = app.getDocumentBase();
  11:             try {
  12:         ...
  13: 
  14:     private Applet findApplet(Container c) {

View Full Code Here
   1: import java.net.URL;
   2: import java.applet.Applet;
   3: 
   4:         ...
   5: 
   6:      protected Applet applet;
   7: 
   8:         ...
   9:                                 try {
  10:                                       URL url = new URL(applet.getDocumentBase(),sval);
  11:                                       nobj = new NamedObject(url,URL);

View Full Code Here

getImage

public Image getImage(URL url)
Returns an Image object that can then be painted on the screen. The url that is passed as an argument must specify an absolute URL.

This method always returns immediately, whether or not the image exists. When this applet attempts to draw the image on the screen, the data will be loaded. The graphics primitives that draw the image will incrementally paint on the screen.

Parameters:
url - an absolute URL giving the location of the image.
Returns:
the image at the specified URL.
See Also:
Image
Usages and Demos :

View More Examples of getImage(URL url)
   1: 
   2: import java.applet.Applet;
   3: import java.awt.*;
   4:         ...
   5: 
   6:     public Image a(boolean flag, boolean flag1, String s, Graphics g, Applet applet)
   7:     {
   8:         ...
   9:             {
  10:                 imageproducer = Toolkit.getDefaultToolkit().getImage(s).getSource();
  11:             } else
  12:         ...
  13:             {
  14:                 imageproducer = applet.getImage(applet.getCodeBase(), s).getSource();

View Full Code Here

getImage

public Image getImage(URL url,
                      String name)
Returns an Image object that can then be painted on the screen. The url argument must specify an absolute URL. The name argument is a specifier that is relative to the url argument.

This method always returns immediately, whether or not the image exists. When this applet attempts to draw the image on the screen, the data will be loaded. The graphics primitives that draw the image will incrementally paint on the screen.

Parameters:
url - an absolute URL giving the base location of the image.
name - the location of the image, relative to the url argument.
Returns:
the image at the specified URL.
See Also:
Image
Usages and Demos :

View More Examples of getImage(URL url,String name)
   1: import java.util.*;
   2: import java.applet.Applet;
   3: import java.awt.image.*;
   4:         ...
   5: 
   6:   public Image(Visu V, Applet app, URL codebase, String filename) {
   7:     super(V);
   8:         ...
   9:     image = app.getImage(codebase, filename);
  10:     MediaTracker m = new MediaTracker(V);

View Full Code Here

getLocale

public Locale getLocale()
Gets the Locale for the applet, if it has been set. If no Locale has been set, then the default Locale is returned.
Overrides:
getLocale in interface Component
Returns:
the Locale for the applet
Since:
JDK1.1

getParameter

public String getParameter(String name)
Returns the value of the named parameter in the HTML tag. For example, if this applet is specified as
 <applet code="Clock" width=50 height=50>
 <param name=Color value="blue">
 </applet>
 

then a call to getParameter("Color") returns the value "blue".

The name argument is case insensitive.

Parameters:
name - a parameter name.
Returns:
the value of the named parameter, or null if not set.
Usages and Demos :

View More Examples of getParameter(String name)
   1: 
   2: import java.applet.*;
   3: import java.net.*;
   4:         ...
   5: 
   6:   public Socket createSocket(String host, int port, Applet applet)
   7:     throws IOException {
   8:         ...
   9:     return createSocket(host, port,
  10:             applet.getParameter("PROXYHOST1"),
  11:         ...
  12:             applet.getParameter("PROXYPORT1"));

View Full Code Here
   1: package org.xmlBlaster.client.protocol.http.applet;
   2: 
   3:         ...
   4: import java.applet.Applet;
   5: import java.util.Hashtable;
   6:         ...
   7: {
   8:    public XmlBlasterAccessRaw(Applet applet) {
   9:       super(parseAppletParameter(applet, null));
  10:         ...
  11:             key = key.trim();
  12:             String value = applet.getParameter(key);

View Full Code Here
   1: 
   2: import java.applet.*;
   3: import java.util.*;
   4:         ...
   5: 
   6:     public AlignmentViewer(String[] args, Applet applet) {
   7:         MbgdDataMng mbgdDataMng = MbgdDataMng.Instance();
   8:         ...
   9:         if (applet != null) {
  10:             String pw = applet.getParameter("pairwise");
  11:             if ((pw != null) && pw.equalsIgnoreCase("on")) {
  12:         ...
  13:             }
  14:             sp1     = applet.getParameter("sp1");

View Full Code Here
   1: 
   2: import java.applet.*;
   3: import java.awt.*;
   4:         ...
   5: 
   6: public class FlexibleApplet extends Applet {
   7: 
   8:         ...
   9: 
  10:   public static void parseParams(Applet applet) {
  11:     _drawAreaWidth = 400;
  12:         ...
  13:     _drawAreaHeight = 300;
  14:     _spawnFrame = "true".equals(applet.getParameter("SpawnFrame"));

View Full Code Here
   1: 
   2: import java.applet.Applet;
   3: import java.net.ServerSocket;
   4:         ...
   5: 
   6:   protected void set_parameters(Applet applet, Properties props)
   7:   {
   8:         ...
   9:     super.set_parameters(applet, props);
  10:     String lp = applet.getParameter(LISTENER_PORT);
  11:     if (lp != null)

View Full Code Here

getParameterInfo

public String[][] getParameterInfo()
Returns information about the parameters that are understood by this applet. An applet should override this method to return an array of Strings describing these parameters.

Each element of the array should be a set of three Strings containing the name, the type, and a description. For example:

 String pinfo[][] = {
	 {"fps",    "1-10",    "frames per second"},
	 {"repeat", "boolean", "repeat image loop"},
	 {"imgs",   "url",     "images directory"}
 };
 

The implementation of this method provided by the Applet class returns null.

Returns:
an array describing the parameters this applet looks for.
Usages and Demos :

View More Examples of getParameterInfo()
   1: 
   2: import java.applet.Applet;
   3: import java.util.Iterator;
   4:         ...
   5: {
   6:     public AppletConfiguration(Applet applet)
   7:     {
   8:         ...
   9:     {
  10:         String[][] paramsInfo = applet.getParameterInfo();
  11:         String[] keys = new String[paramsInfo != null ? paramsInfo.length : 0];

View Full Code Here
   1: 
   2: import java.applet.Applet;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:   protected void set_parameters(Applet app, Properties props)
   7:   {
   8:         ...
   9: 
  10:     String[][] para = app.getParameterInfo();
  11:     if (para != null)

View Full Code Here

init

public void init()
Called by the browser or applet viewer to inform this applet that it has been loaded into the system. It is always called before the first time that the start method is called.

A subclass of Applet should override this method if it has initialization to perform. For example, an applet with threads would use the init method to create the threads and the destroy method to kill them.

The implementation of this method provided by the Applet class does nothing.

Usages and Demos :

View More Examples of init()
   1: import java.applet.*;
   2: import java.awt.*;
   3:         ...
   4:         Class AppletClass = ucl.loadClass(classname, true);
   5:         Applet apl = (Applet) AppletClass.newInstance();
   6:         
   7:         ...
   8:         f.add("Center", apl);
   9:         apl.init();
  10:         apl.start();

View Full Code Here
   1: 
   2: package ccs.cpc.applet;
   3: 
   4:         ...
   5: import java.applet.*;
   6: import java.awt.*;
   7:         ...
   8: private boolean isActive;
   9: private Applet applet;
  10: private HashMap<String, String> params;
  11:         ...
  12:     if (applet == null) return;
  13:     applet.init();

View Full Code Here
   1: package http.applet;
   2: 
   3:         ...
   4: import org.xmlBlaster.client.protocol.http.applet.XmlBlasterAccessRaw;
   5: import org.xmlBlaster.client.protocol.http.common.I_CallbackRaw;
   6:         ...
   7: 
   8: import java.applet.Applet;
   9: import java.awt.TextArea;
  10:         ...
  11:       this.runAsApplet = true;
  12:       print("Applet.init() called");

View Full Code Here
   1: 
   2: package org.makagiga.commons.applet;
   3: 
   4:         ...
   5: 
   6: import java.applet.Applet;
   7:         ...
   8: import java.applet.AppletContext;
   9: import java.applet.AppletStub;
  10:         ...
  11:         applet.setStub(new Stub(base, config));
  12:         applet.init();

View Full Code Here
   1: 
   2: import java.applet.Applet;
   3:         ...
   4: import java.applet.AppletContext;
   5:         ...
   6: import java.applet.AppletStub;
   7: import java.awt.BorderLayout;
   8:         ...
   9:         app.setStub(new AppletFrameStub());
  10:         app.init();

View Full Code Here

isActive

public boolean isActive()
Determines if this applet is active. An applet is marked active just before its start method is called. It becomes inactive just before its stop method is called.
Returns:
true if the applet is active; false otherwise.
See Also:
start(), stop()

newAudioClip

public static final AudioClip newAudioClip(URL url)
Get an audio clip from the given URL.
Parameters:
url - points to the audio clip
Returns:
the audio clip at the specified URL.
Since:
1.2
Usages and Demos :

View More Examples of newAudioClip(URL url)
   1: 
   2: import java.applet.Applet;
   3:         ...
   4: import java.applet.AudioClip;
   5: import java.net.URL;
   6: import java.net.MalformedURLException;

View Full Code Here
   1: import java.applet.*;
   2: import java.awt.*;
   3:         ...
   4:     java.io.File file = new java.io.File( args[0] );
   5:     final AudioClip sound = Applet.newAudioClip(file.toURL(  ));
   6: 
   7:     JButton button = new JButton("Woof!");
   8:     button.addActionListener(new ActionListener(  ) {

View Full Code Here
   1: import java.applet.*;
   2: import java.net.*;
   3:         ...
   4:                 URL snd = new URL(av[i]);
   5:                 Applet.newAudioClip(snd).play();
   6:             } catch (Exception e) {
   7:                 System.err.println(e);
   8:             }

View Full Code Here
   1: 
   2: import java.applet.*;
   3: 
   4:         ...
   5:       try {
   6:          return Applet.newAudioClip( getClass().getResource( 
   7:             prefix + soundFile ) );
   8:       }

View Full Code Here
   1: import java.awt.event.*;
   2: import java.applet.*;
   3: import java.io.*;
   4:         ...
   5: 
   6:         AudioClip clip = Applet.newAudioClip(getClass().getResource("/splash.mid"));
   7:         clip.play();
   8:     }

View Full Code Here

play

public void play(URL url)
Plays the audio clip at the specified absolute URL. Nothing happens if the audio clip cannot be found.
Parameters:
url - an absolute URL giving the location of the audio clip.

play

public void play(URL url,
                 String name)
Plays the audio clip given the URL and a specifier that is relative to it. Nothing happens if the audio clip cannot be found.
Parameters:
url - an absolute URL giving the base location of the audio clip.
name - the location of the audio clip, relative to the url argument.

resize

public void resize(int width,
                   int height)
Requests that this applet be resized.
Parameters:
width - the new requested width for the applet.
height - the new requested height for the applet.

resize

public void resize(Dimension d)
Requests that this applet be resized.
Parameters:
d - an object giving the new width and height.

setStub

public final void setStub(AppletStub stub)
Sets this applet's stub. This is done automatically by the system.

If there is a security manager, its checkPermission method is called with the AWTPermission("setAppletStub") permission if a stub has already been set.

Parameters:
stub - the new stub.
Throws:
SecurityException - if the caller cannot set the stub
Usages and Demos :

View More Examples of setStub(AppletStub stub)
   1: 
   2: package ccs.cpc.applet;
   3: 
   4:         ...
   5: import java.applet.*;
   6: import java.awt.*;
   7:         ...
   8: private boolean isActive;
   9: private Applet applet;
  10: private HashMap<String, String> params;
  11:         ...
  12:     streams.clear();
  13:     applet.setStub(this);

View Full Code Here
   1: package kaffe.applet;
   2: 
   3:         ...
   4: import java.applet.Applet;
   5:         ...
   6: import java.applet.AppletContext;
   7: import java.applet.AppletStub;
   8:         ...
   9:         app = (Applet) c.newInstance();
  10:         app.setStub( this);

View Full Code Here

showStatus

public void showStatus(String msg)
Requests that the argument string be displayed in the "status window". Many browsers and applet viewers provide such a window, where the application can inform users of its current state.
Parameters:
msg - a string to display in the status window.
Usages and Demos :

View More Examples of showStatus(String msg)
   1: import java.applet.*;
   2: import java.awt.*;
   3:         ...
   4:     String t;
   5:     URLButton(Applet parent, String t, URL u) {
   6:         super(t);
   7:         ...
   8:     public void mouseEntered(MouseEvent e) {
   9:         parent.showStatus(u.toExternalForm());
  10:     }

View Full Code Here
   1: package org.rcosjava.software.animator.support;
   2: import java.applet.Applet;
   3: 
   4:         ...
   5:   String[] sAreas;
   6:   Applet theApplet;
   7: 
   8:         ...
   9:       String highlight, String areas[],
  10:       Applet aApplet)
  11:   {
  12:         ...
  13:   {
  14:     theApplet.showStatus(s);

View Full Code Here
   1: import java.awt.*;
   2: import java.applet.Applet;
   3: import java.awt.event.*;
   4:         ...
   5:   Image sImg;
   6:   Applet theApplet;
   7: 
   8:         ...
   9:                    String highlight, String areas[],
  10:                    Applet aApplet)
  11:   {
  12:         ...
  13:   {
  14:     theApplet.showStatus(s);

View Full Code Here

start

public void start()
Called by the browser or applet viewer to inform this applet that it should start its execution. It is called after the init method and each time the applet is revisited in a Web page.

A subclass of Applet should override this method if it has any operation that it wants to perform each time the Web page containing it is visited. For example, an applet with animation might want to use the start method to resume animation, and the stop method to suspend the animation.

Note: some methods, such as getLocationOnScreen, can only provide meaningful results if the applet is showing. Because isShowing returns false when the applet's start is first called, methods requiring isShowing to return true should be called from a ComponentListener.

The implementation of this method provided by the Applet class does nothing.

Usages and Demos :

View More Examples of start()
   1: import java.applet.*;
   2: import java.awt.*;
   3:         ...
   4:         Class AppletClass = ucl.loadClass(classname, true);
   5:         Applet apl = (Applet) AppletClass.newInstance();
   6:         
   7:         ...
   8:         apl.init();
   9:         apl.start();
  10:         f.show();

View Full Code Here
   1: 
   2: import java.applet.Applet;
   3: import java.net.URL;
   4:         ...
   5: import org.makagiga.commons.*;
   6: import org.makagiga.commons.applet.MApplet;
   7: import org.makagiga.plugins.AbstractPlugin;
   8:         ...
   9:     private boolean started;
  10:     private Applet applet;
  11:     
  12:         ...
  13:         if (!started && (applet != null)) {
  14:             applet.start();

View Full Code Here
   1: 
   2: package ccs.cpc.applet;
   3: 
   4:         ...
   5: import java.applet.*;
   6: import java.awt.*;
   7:         ...
   8: private boolean isActive;
   9: private Applet applet;
  10: private HashMap<String, String> params;
  11:         ...
  12:     isActive = true;
  13:     applet.start();

View Full Code Here
   1: 
   2: import java.applet.Applet;
   3:         ...
   4: import java.applet.AppletContext;
   5:         ...
   6: import java.applet.AppletStub;
   7: import java.awt.BorderLayout;
   8:         ...
   9:         app.init();
  10:         app.start();

View Full Code Here
   1: package http.applet;
   2: 
   3:         ...
   4: import org.xmlBlaster.client.protocol.http.applet.XmlBlasterAccessRaw;
   5: import org.xmlBlaster.client.protocol.http.common.I_CallbackRaw;
   6:         ...
   7: 
   8: import java.applet.Applet;
   9: import java.awt.TextArea;
  10:         ...
  11:    public void start() {
  12:       System.out.println("HelloWorld3: Applet.start() called");

View Full Code Here

stop

public void stop()
Called by the browser or applet viewer to inform this applet that it should stop its execution. It is called when the Web page that contains this applet has been replaced by another page, and also just before the applet is to be destroyed.

A subclass of Applet should override this method if it has any operation that it wants to perform each time the Web page containing it is no longer visible. For example, an applet with animation might want to use the start method to resume animation, and the stop method to suspend the animation.

The implementation of this method provided by the Applet class does nothing.

See Also:
destroy(), init()
Usages and Demos :

View More Examples of stop()
   1: 
   2: import java.applet.Applet;
   3: import java.net.URL;
   4:         ...
   5: import org.makagiga.commons.*;
   6: import org.makagiga.commons.applet.MApplet;
   7: import org.makagiga.plugins.AbstractPlugin;
   8:         ...
   9:     private boolean started;
  10:     private Applet applet;
  11:     
  12:         ...
  13:         if (started && (applet != null)) {
  14:             applet.stop();

View Full Code Here
   1: import java.applet.*;
   2: import java.awt.*;
   3:         ...
   4:     Graphics g = null;
   5:     Applet applet = null;
   6: 
   7:         ...
   8:       if (applet != null) {
   9:         applet.stop();
  10:         applet.destroy();

View Full Code Here
   1: import java.applet.*;
   2: import java.awt.*;
   3:         ...
   4:     Graphics g = null;
   5:     Applet applet = null;
   6: 
   7:         ...
   8:       if (applet != null) {
   9:         applet.stop();
  10:         applet.destroy();

View Full Code Here
   1: 
   2: package ccs.cpc.applet;
   3: 
   4:         ...
   5: import java.applet.*;
   6: import java.awt.*;
   7:         ...
   8: private boolean isActive;
   9: private Applet applet;
  10: private HashMap<String, String> params;
  11:         ...
  12:     isActive = false;
  13:     applet.stop();

View Full Code Here
   1: package kaffe.applet;
   2: 
   3:         ...
   4: import java.applet.Applet;
   5:         ...
   6: import java.applet.AppletContext;
   7: import java.applet.AppletStub;
   8:         ...
   9:         if (app != null) {
  10:             app.stop();

View Full Code Here