home *** CD-ROM | disk | FTP | other *** search
/ Java 1996 August / Java - Summer 1996.iso / rockridge / ui / layout / example / NoneEx1.java < prev    next >
Encoding:
Java Source  |  1995-11-13  |  637 b   |  36 lines

  1. import java.awt.*;
  2. import java.applet.Applet;
  3.  
  4. public class NoneEx1 extends Applet {
  5.  
  6.     public void init() {
  7.         Button b1, b2, b3;
  8.  
  9.     setLayout(null);
  10.     setFont(new Font("Helvetica", Font.PLAIN, 14));
  11.  
  12.     b1 = new Button("one");
  13.     add(b1);
  14.     b1.reshape(50, 5, 50, 20);
  15.  
  16.     b2 = new Button("two");
  17.     add(b2);
  18.     b2.reshape(70, 35, 50, 20);
  19.  
  20.     b3 = new Button("three");
  21.     add(b3);
  22.     b3.reshape(130, 15, 50, 30);
  23.     }
  24.  
  25.     public static void main(String args[]) {
  26.     Frame f = new Frame("No Layout Manager Example");
  27.     NoneEx1 ex1 = new NoneEx1();
  28.  
  29.     ex1.init();
  30.         f.add("Center", ex1);
  31.     f.pack();
  32.     f.resize(250, 90);
  33.         f.show();
  34.     }
  35. }
  36.