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(java.applet.AppletStub) sample code for java.applet.Applet.setStub(java.applet.AppletStub) definition code for java.applet.Applet.setStub(java.applet.AppletStub)

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

Method Detail

isActive sample code for java.applet.AppletStub.isActive() definition code for java.applet.AppletStub.isActive()

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.

getDocumentBase sample code for java.applet.AppletStub.getDocumentBase() definition code for java.applet.AppletStub.getDocumentBase()

URL sample code for java.net.URL definition code for java.net.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 sample code for java.net.URL definition code for java.net.URL of the document that contains the applet.
See Also:
getCodeBase() sample code for java.applet.AppletStub.getCodeBase() definition code for java.applet.AppletStub.getCodeBase()

getCodeBase sample code for java.applet.AppletStub.getCodeBase() definition code for java.applet.AppletStub.getCodeBase()

URL sample code for java.net.URL definition code for java.net.URL  getCodeBase()
Gets the base URL. This is the URL of the directory which contains the applet.

Returns:
the base URL sample code for java.net.URL definition code for java.net.URL of the directory which contains the applet.
See Also:
getDocumentBase() sample code for java.applet.AppletStub.getDocumentBase() definition code for java.applet.AppletStub.getDocumentBase()

getParameter sample code for java.applet.AppletStub.getParameter(java.lang.String) definition code for java.applet.AppletStub.getParameter(java.lang.String)

String sample code for java.lang.String definition code for java.lang.String  getParameter(String sample code for java.lang.String definition code for java.lang.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.

getAppletContext sample code for java.applet.AppletStub.getAppletContext() definition code for java.applet.AppletStub.getAppletContext()

AppletContext sample code for java.applet.AppletContext definition code for java.applet.AppletContext  getAppletContext()
Gets a handler to the applet's context.

Returns:
the applet's context.

appletResize sample code for java.applet.AppletStub.appletResize(int, int) definition code for java.applet.AppletStub.appletResize(int, int)

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.