Short Example: Old AWT
import java.awt.*;
public class HelloWorld extends Frame {
public Button bOld;
//public Panel p;
public HelloWorld() {
bOld = new Button ("Good Bye");
//p = new Panel();
//p.add(bOld);
//this.add(p);
this.add(bOld);
/* note the addition directly to Frame*/
this.pack();
}
public static void main(String arg[]){
/* note lack of listener; this is a demo */
new HelloWorld().show();
}
}// class HelloWorld
Previous slide
Next slide
Back to first slide
View graphic version