JavaApplet Context

 

 

 

Foreword

Resources

Code Listings

Foil Sets

Assignments

Solutions

External Resources

SiteMap

Search

Home

 

Up ] Thread Base Applet ] Math Class ] String Classes ] Off Screen GC ] [ JavaApplet Context ] Events ] Networking ] Java Appl Design ]

The Applet Context

This interface corresponds to an Applet's environment. It can be used by an applet to obtain information from the applet's environment, which is usually the browser or the applet viewer.

Usage of Applet Context

When you want to use the methods provide by Applet Context, you can use getAppletContext() inside your Applet then use it to reference the method you want.

    getAppletContext().method_name(...);

JAVA API reference : java.applet.AppletContext

Examples on Applet Context Class

The following is an example that show you the usage of showStatus() and showDocument(). When you press the ShowStatus button, you will see "You click on Show Status!" that show below in the browser's status bar. When you press the ShowDocument button, the browser will display the file "Context.java" on screen.

Source code :

Context.java
Receiver.java