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 / dDraw / ddex3 / TestGraphFrame.java < prev   
Encoding:
Java Source  |  1996-10-10  |  483 b   |  33 lines

  1. import java.awt.*;
  2.  
  3. class TestGraphFrame extends Frame
  4. {
  5.         
  6.  
  7.     public TestGraphFrame(String str)
  8.     {
  9.         super (str);
  10.     }
  11.  
  12.     public boolean handleEvent(Event evt)
  13.     {
  14.         switch (evt.id)
  15.         {
  16.             case Event.WINDOW_DESTROY:
  17.                 dispose();
  18.                 System.exit(0);
  19.                 return true;
  20.  
  21.             case Event.KEY_ACTION:
  22.                 if(evt.key == Event.F12)
  23.                 {
  24.                     dispose();
  25.                     System.exit(0);
  26.                     return true;
  27.                 }                
  28.             default:
  29.                 return super.handleEvent(evt);
  30.         }             
  31.     }
  32. }
  33.