| Simple Delegation program (1) | |
import java.awt.Button;
import java.awt.Label;
import java.awt.event.ActionListener;
public class DelegateDemo extends Frame {
public static void main(String argv[]) {
new SimpleEvent().setVisible(true);
}
public DelegateDemo() {
// create the GUI objects
Button left = new Button("Left");
Button right = new Button("Right");
Label label = new Label();
// set their geometry
add(left, "West");
add(right, "East");
add(label, "Center");
pack();
| Slide 39 | ©Copyright 1997 | Jan Newmarch |