Package java.applet Previous
Previous
Java API
Java API
Index
Index
Next
Next

Interface AppletStub

Methods

public  interface  java.applet.AppletStub
{
        // Methods
    public abstract void appletResize(int  width, int  height);	
    public abstract AppletContext getAppletContext();	
    public abstract URL getCodeBase();	
    public abstract URL getDocumentBase();	
    public abstract String getParameter(String  name);	
    public abstract boolean isActive();	
}

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.


Methods


appletResize

public abstract void appletResize(int  width, int  height) 

Called when the applet wants to be resized.

ParameterDescription
width the new requested width for the applet
height the new requested height for the applet


getAppletContext

public abstract AppletContext getAppletContext() 

Return Value:

Returns the applet's context.


getCodeBase

public abstract URL getCodeBase() 

Return Value:

Returns the URL of the applet.


getDocumentBase

public abstract URL getDocumentBase() 

Return Value:

Returns the URL of the document containing the applet.


getParameter

public abstract 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> 

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

Return Value:

Returns the value of the named parameter.

ParameterDescription
name a parameter name


isActive

public abstract boolean isActive() 

Determines if the applet is active. An applet is active just before its start method is called. It becomes inactive immediately after its stop method is called.

Return Value:

Returns true if the applet is active; false otherwise.



Top© 1996 Sun Microsystems, Inc. All rights reserved.