home *** CD-ROM | disk | FTP | other *** search
/ Chip Special: HTML & Java / Chip-Special_1997-01_HTML-a-Java.bin / javasdk / sdk-java.exe / SDKJava.cab / Samples / directX / dSound / dSoundTest / dSoundTestFrame.java < prev    next >
Encoding:
Java Source  |  1996-10-10  |  1.5 KB  |  51 lines

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