home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-10-24 | 1.9 KB | 63 lines |
- //******************************************************************************
- // XMLViewerFrame.java:
- //
- //******************************************************************************
- import java.awt.*;
- import java.applet.*;
-
- //==============================================================================
- // STANDALONE APPLICATION SUPPORT
- // This frame class acts as a top-level window in which the applet appears
- // when it's run as a standalone application.
- //==============================================================================
- class XMLViewerFrame extends Frame
- {
- // XMLViewerFrame constructor
- //--------------------------------------------------------------------------
- public XMLViewerFrame(String str, Applet parent)
- {
- // TODO: Add additional construction code here
- super (str);
- alive = true;
- this.parent = parent;
- }
-
- // The handleEvent() method receives all events generated within the frame
- // window. You can use this method to respond to window events. To respond
- // to events generated by menus, buttons, etc. or other controls in the
- // frame window but not managed by the applet, override the window's
- // action() method.
- //--------------------------------------------------------------------------
- public boolean handleEvent(Event evt)
- {
- switch (evt.id)
- {
- // Application shutdown (e.g. user chooses Close from the system menu).
- //------------------------------------------------------------------
- case Event.WINDOW_DESTROY:
- alive = false;
- dispose();
- return true;
-
- default:
- return super.handleEvent(evt);
- }
- }
-
- public boolean action(Event evt, Object what)
- {
- if( parent != null )
- return parent.handleEvent(evt);
- else
- return false;
- }
-
- public boolean isAlive()
- {
- return alive;
- }
-
- Applet parent;
- boolean alive;
- }
-