home *** CD-ROM | disk | FTP | other *** search
/ Java Programmer's Toolkit / Java Programmer's Toolkit.iso / project / button~1.jav < prev   
Encoding:
Text File  |  1995-10-31  |  426 b   |  21 lines

  1. import java.awt.*;
  2.  
  3. public class ButtonExample extends Frame {
  4.     public ButtonExample() {
  5.         setTitle("ButtonExample");
  6.         setLayout(new FlowLayout());
  7.         add(new Button("Push Me"));
  8.         pack();
  9.         show();
  10.     }
  11.     public boolean handleEvent(Event e) {
  12.         if (e.id == Event.WINDOW_DESTROY) {
  13.             System.exit(0);
  14.         }
  15.         return super.handleEvent(e);
  16.     }
  17.     public static void main(String args[]) {
  18.         new ButtonExample();
  19.     }
  20. }
  21.