home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 December / PCWKCD1296.iso / vjplusb / msdev / samples / microsoft / javabeep / javabeepframe.java < prev    next >
Text File  |  1996-07-12  |  2KB  |  45 lines

  1. //******************************************************************************
  2. // javabeepframe.java:    
  3. //
  4. //******************************************************************************
  5. import java.awt.*;
  6.  
  7. //==============================================================================
  8. // STANDALONE APPLICATION SUPPORT
  9. //     This frame class acts as a top-level window in which the applet appears
  10. // when it's run as a standalone application.
  11. //==============================================================================
  12. class javabeepframe extends Frame
  13. {
  14.     // javabeepframe constructor
  15.     //--------------------------------------------------------------------------
  16.     public javabeepframe(String str)
  17.     {
  18.         // TODO: Add additional construction code here
  19.         super (str);
  20.     }
  21.  
  22.     // The handleEvent() method receives all events generated within the frame
  23.     // window. You can use this method to respond to window events. To respond
  24.     // to events generated by menus, buttons, etc. or other controls in the
  25.     // frame window but not managed by the applet, override the window's
  26.     // action() method.
  27.     //--------------------------------------------------------------------------
  28.     public boolean handleEvent(Event evt)
  29.     {
  30.         switch (evt.id)
  31.         {
  32.             // Application shutdown (e.g. user chooses Close from the system menu).
  33.             //------------------------------------------------------------------
  34.             case Event.WINDOW_DESTROY:
  35.                 // TODO: Place additional clean up code here
  36.                 dispose();
  37.                 System.exit(0);
  38.                 return true;
  39.  
  40.             default:
  41.                 return super.handleEvent(evt);
  42.         }             
  43.     }
  44. }
  45.