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
-
ApplicationApplet()
-
-
getAppletInfo()
- Applet info.
-
getArgs()
- Get the ARGS parameter and parse it into an array of Strings.
-
getParameterInfo()
- Parameter info.
-
init()
- Called when the applet is first created.
-
main(String[])
- Main program, so we can run as an application too.
-
run()
- This is the part of Runnable that we implement - the routine that
gets called when the thread is started.
-
start()
- Called when the applet should start itself.
-
stop()
- Called when the applet should stop itself.
ApplicationApplet
public ApplicationApplet()
getAppletInfo
public String getAppletInfo()
- Applet info.
- Overrides:
- getAppletInfo in class Applet
getParameterInfo
public String[][] getParameterInfo()
- Parameter info.
- Overrides:
- getParameterInfo in class Applet
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
getArgs
public void getArgs()
- Get the ARGS parameter and parse it into an array of Strings.
start
public void start()
- Called when the applet should start itself.
- Overrides:
- start in class Applet
stop
public void stop()
- Called when the applet should stop itself.
- Overrides:
- stop in class Applet
run
public void run()
- This is the part of Runnable that we implement - the routine that
gets called when the thread is started.
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