All Packages  Class Hierarchy  This Package  Previous  Next  Index


Class Acme.MainFrame

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Frame
                                   |
                                   +----Acme.MainFrame

public class MainFrame
extends Frame
implements Runnable, AppletStub, AppletContext
Run an Applet as an application.

Using this class you can add a trivial main program to any Applet and run it directly, as well as from a browser or the appletviewer. And unlike some versions of this concept, MainFrame implements both images and sound.

Sample main program:

 public static void main( String[] args )
     {
     new Acme.MainFrame( new ThisApplet(), args, 400, 400 );
     }
 
The only methods you need to know about are the constructors.

You can specify Applet parameters on the command line, as name=value. For instance, the equivalent of:

 <PARAM NAME="pause" VALUE="200">
 
would just be:
 pause=200
 
You can also specify three special parameters:
 width=N          Width of the Applet.
 height=N         Height of the Applet.
 barebones=true   Leave off the menu bar and status area.
 

Fetch the software.
Fetch the entire Acme package.


Constructor Index

 o MainFrame(Applet, int, int)
Constructor with no arg parsing.
 o MainFrame(Applet, String[])
Constructor with no default width/height.
 o MainFrame(Applet, String[], int, int)
Constructor with everything specified.

Method Index

 o appletResize(int, int)
 o getApplet(String)
 o getAppletContext()
 o getApplets()
 o getAudioClip(URL)
 o getCodeBase()
 o getDocumentBase()
 o getImage(URL)
 o getParameter(String)
 o handleEvent(Event)
Event handler for the menu bar.
 o isActive()
 o run()
Separate thread to call the applet's init() and start() methods.
 o showDocument(URL)
 o showDocument(URL, String)
 o showStatus(String)

Constructors

 o MainFrame
 public MainFrame(Applet applet,
                  String args[],
                  int width,
                  int height)
Constructor with everything specified.

 o MainFrame
 public MainFrame(Applet applet,
                  String args[])
Constructor with no default width/height.

 o MainFrame
 public MainFrame(Applet applet,
                  int width,
                  int height)
Constructor with no arg parsing.

Methods

 o handleEvent
 public boolean handleEvent(Event evt)
Event handler for the menu bar.

Overrides:
handleEvent in class Component
 o run
 public void run()
Separate thread to call the applet's init() and start() methods.

 o isActive
 public boolean isActive()
Overrides:
isActive in class Window
 o getDocumentBase
 public URL getDocumentBase()
 o getCodeBase
 public URL getCodeBase()
 o getParameter
 public String getParameter(String name)
 o appletResize
 public void appletResize(int width,
                          int height)
 o getAppletContext
 public AppletContext getAppletContext()
 o getAudioClip
 public AudioClip getAudioClip(URL url)
 o getImage
 public Image getImage(URL url)
 o getApplet
 public Applet getApplet(String name)
 o getApplets
 public Enumeration getApplets()
 o showDocument
 public void showDocument(URL url)
 o showDocument
 public void showDocument(URL url,
                          String target)
 o showStatus
 public void showStatus(String status)

All Packages  Class Hierarchy  This Package  Previous  Next  Index

ACME Java  ACME Labs