home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / viscobv7.zip / vac22os2 / ibmcobol / macros / java.smp < prev    next >
Text File  |  1998-02-24  |  854b  |  34 lines

  1. /* Comment */
  2. import java.awt.*;
  3.  
  4. public class MyClass extends java.applet.Applet {
  5.   private Button OkButton = null;
  6.   private TextArea aTextArea = null;
  7.   public MyClass() {
  8.     aTextArea = new TextArea(\0x10, \0x40);
  9.     OkButton = new Button("Ok");
  10.   }
  11.   public void init() {
  12.     setLayout(new BorderLayout));
  13.     add("Center", aTextArea);
  14.     add("South", OkButton);
  15.   )
  16.   public static void main(String args[]) {
  17.     MyFrame frame = new MyFrame("My applet);
  18.     MyClass instance = new MyClass();
  19.     instance.init();
  20.     instance.start();
  21.     instance.repaint();
  22.     frame.show();
  23.   }
  24. }
  25.  
  26. class public MyFrame extends Frame {
  27.   public MyFrame(String title) {super(title);}
  28.   public Boolean handleEvent(Event ev) {
  29.     if (ev.id == Event.WINDOW_DESTROY)
  30.       System.exit(0);
  31.     return super.handleEvent(ev);
  32.   }
  33. }
  34.