All Packages  Class Hierarchy  This Package  Previous  Next  Index


Class Acme.ApplicationApplet

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----java.applet.Applet
                                   |
                                   +----Acme.ApplicationApplet

public class ApplicationApplet
extends Applet
implements Runnable
Run an Application in an Applet.

This applet lets any command-line application that uses a specially-enhanced main() routine automatically run in a web browser or appletviewer. Here's an example:

That's a command-line application running right now in your own browser.

The applet takes two parameters:

CLASS
The name of the class to run - your Application's name.
ARGS
The arguments to pass to the Application.

Fetch the software.
Fetch the entire Acme package.

For details on how to adapt your application so that it can be run by ApplicationApplet,

See Also:
Application

Constructor Index

 o ApplicationApplet()

Method Index

 o getAppletInfo()
Applet info.
 o getArgs()
Get the ARGS parameter and parse it into an array of Strings.
 o getParameterInfo()
Parameter info.
 o init()
Called when the applet is first created.
 o main(String[])
Main program, so we can run as an application too.
 o run()
This is the part of Runnable that we implement - the routine that gets called when the thread is started.
 o start()
Called when the applet should start itself.
 o stop()
Called when the applet should stop itself.

Constructors

 o ApplicationApplet
 public ApplicationApplet()

Methods

 o getAppletInfo
 public String getAppletInfo()
Applet info.

Overrides:
getAppletInfo in class Applet
 o getParameterInfo
 public String[][] getParameterInfo()
Parameter info.

Overrides:
getParameterInfo in class Applet
 o init
 public void init()
Called when the applet is first created. This could be overridden by a subclass to define what application to run and what args to give it. This default version gets the application name and args list from the parameters. A sample overriding version:
 public void init()
     {
     app = new MyApp();   // make an instance of this application
     getArgs();           // get args from the applet parameters
     }
 
Pretty simple.

Overrides:
init in class Applet
 o getArgs
 public void getArgs()
Get the ARGS parameter and parse it into an array of Strings.

 o start
 public void start()
Called when the applet should start itself.

Overrides:
start in class Applet
 o stop
 public void stop()
Called when the applet should stop itself.

Overrides:
stop in class Applet
 o run
 public void run()
This is the part of Runnable that we implement - the routine that gets called when the thread is started.

 o main
 public static void main(String args[])
Main program, so we can run as an application too.


All Packages  Class Hierarchy  This Package  Previous  Next  Index

ACME Java  ACME Labs