-
public interface AppletStub
When an applet is first created, an applet stub is attached to it using the applet'ssetStub
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)
-
-
Method Summary
Methods Modifier and Type Method and Description void
appletResize(int width, int height)
Called when the applet wants to be resized.AppletContext
getAppletContext()
Returns 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 Detail
-
isActive
boolean isActive()
Determines if the applet is active. An applet is active just before itsstart
method is called. It becomes inactive just before itsstop
method is called.- Returns:
true
if the applet is active;false
otherwise.
-
getDocumentBase
URL getDocumentBase()
Gets the URL of the document in which the applet is embedded. For example, suppose an applet is contained within the document:
The document base is:http://java.sun.com/products/jdk/1.2/index.html
http://java.sun.com/products/jdk/1.2/index.html
- Returns:
- the
URL
of the document that contains the applet. - See Also:
getCodeBase()
-
getCodeBase
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. - See Also:
getDocumentBase()
-
getParameter
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.
-
getAppletContext
AppletContext getAppletContext()
Returns the applet's context.- Returns:
- the applet's context.
-
appletResize
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.
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-java/applet/appletstub.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.