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 / AWT / menux / menuxFrame.java < prev    next >
Encoding:
Java Source  |  1996-10-15  |  1.9 KB  |  52 lines

  1. //******************************************************************************
  2. // menuxFrame.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 menuxFrame extends Frame
  13. {
  14.     public String frameMenu[] = {
  15.     "File", "About" , "Open" , "AnimSet" , "OpenFrame" , "Exit" , "Edit" , "Cut" , "Copy" ,
  16.     "Paste" , "Delete" , "Color" , "Boxes" , "Quality" , "Lighting" , "Points" , "Wireframe" ,
  17.      "Solid" , "Flat" , "Gouraud" , "Phong" , "Mono" , "Rgb" , "Dither" , "Filtering" , "Light" ,
  18.     "Directional" ,  "Parallel" , "Point" , "Spot" 
  19.     };
  20.  
  21.     // menuxFrame constructor
  22.     //--------------------------------------------------------------------------
  23.     public menuxFrame(String str)
  24.     {
  25.         // TODO: Add additional construction code here
  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.                 // TODO: Place additional clean up code here
  43.                 dispose();
  44.                 System.exit(0);
  45.                 return true;
  46.  
  47.             default:
  48.                 return super.handleEvent(evt);
  49.         }             
  50.     }
  51. }
  52.