java.applet

Interface AppletStub

public interface AppletStub

When an applet is first created, an applet stub is attached to it using the applet's setStub method. This stub serves as the interface between the applet and the browser environment or applet viewer environment in which the application is running.
Since:
JDK1.0
See Also:
Applet.setStub(AppletStub)

Method Summary

void
appletResize(int width, int height)
Called when the applet wants to be resized.
AppletContext
getAppletContext()
Gets a handler to the applet's context.
URL
getCodeBase()
Gets the base URL.
URL
getDocumentBase()
Gets the URL of the document in which the applet is embedded.
String
getParameter(String name)
Returns the value of the named parameter in the HTML tag.
boolean
isActive()
Determines if the applet is active.

Method Details

appletResize

public void appletResize(int width,
                         int height)
Called when the applet wants to be resized.
Parameters:
width - the new requested width for the applet.
height - the new requested height for the applet.

getAppletContext

public AppletContext getAppletContext()
Gets a handler to the applet's context.
Returns:
the applet's context.
Usages and Demos :

View More Examples of getAppletContext()
   1:   {
   2:     setStub((AppletStub)getClientProperty("KORTE_STUB"));
   3:     setDoubleBuffered(false);
   4:         ...
   5: 
   6:   private AppletStub stub_     =null;
   7:   private boolean    destroyed_=false;
   8:         ...
   9:   {
  10:     return stub_.getAppletContext();
  11:   }
  12:         ...
  13: 
  14:   public final void setStub(AppletStub _stub)

View Full Code Here

getCodeBase

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

View More Examples of getCodeBase()
   1:   {
   2:     setStub((AppletStub)getClientProperty("KORTE_STUB"));
   3:     setDoubleBuffered(false);
   4:         ...
   5: 
   6:   private AppletStub stub_     =null;
   7:   private boolean    destroyed_=false;
   8:         ...
   9:   {
  10:     return stub_.getCodeBase();
  11:   }
  12:         ...
  13: 
  14:   public final void setStub(AppletStub _stub)

View Full Code Here

getDocumentBase

public URL getDocumentBase()
Gets the URL of the document in which the 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 the applet.
See Also:
getCodeBase()
Usages and Demos :

View More Examples of getDocumentBase()
   1:   {
   2:     setStub((AppletStub)getClientProperty("KORTE_STUB"));
   3:     setDoubleBuffered(false);
   4:         ...
   5: 
   6:   private AppletStub stub_     =null;
   7:   private boolean    destroyed_=false;
   8:         ...
   9:   {
  10:     return stub_.getDocumentBase();
  11:   }
  12:         ...
  13: 
  14:   public final void setStub(AppletStub _stub)

View Full Code Here

getParameter

public String getParameter(String name)
Returns the value of the named parameter in the HTML tag. For example, if an 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".

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:     setStub((AppletStub)getClientProperty("KORTE_STUB"));
   3:     setDoubleBuffered(false);
   4:         ...
   5: 
   6:   private AppletStub stub_     =null;
   7:   private boolean    destroyed_=false;
   8:         ...
   9:   {
  10:     return stub_.getParameter(name);
  11:   }
  12:         ...
  13: 
  14:   public final void setStub(AppletStub _stub)

View Full Code Here

isActive

public boolean isActive()
Determines if the applet is active. An applet is 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.
Usages and Demos :

View More Examples of isActive()
   1:   {
   2:     setStub((AppletStub)getClientProperty("KORTE_STUB"));
   3:     setDoubleBuffered(false);
   4:         ...
   5: 
   6:   private AppletStub stub_     =null;
   7:   private boolean    destroyed_=false;
   8:         ...
   9:   {
  10:     return (stub_!=null ? stub_.isActive() : false);
  11:   }
  12:         ...
  13: 
  14:   public final void setStub(AppletStub _stub)

View Full Code Here