import java.awt.*;
import java.awt.event.*;

// This appears in Core Web Programming from
// Prentice Hall Publishers, and may be freely used
// or adapted. 1997 Marty Hall, hall@apl.jhu.edu.

// JDK 1.1 Only

public class ButtonExample extends CloseableFrame {
  public static void main(String[] args) {
    new ButtonExample();
  }

  public ButtonExample() {
    super("Using ActionListeners in JDK 1.1");
    setLayout(new FlowLayout());
    Button b1 = new Button("Button 1");
    Button b2 = new Button("Button 2");
    Button b3 = new Button("Button 3");
    b1.setBackground(Color.lightGray);
    b2.setBackground(Color.gray);
    b3.setBackground(Color.darkGray);
    FgReporter fgReporter = new FgReporter();
    BgReporter bgReporter = new BgReporter();
    SizeReporter sizeReporter = new SizeReporter();
    b1.addActionListener(fgReporter);
    b2.addActionListener(fgReporter);
    b2.addActionListener(bgReporter);
    b3.addActionListener(fgReporter);
    b3.addActionListener(bgReporter);
    b3.addActionListener(sizeReporter);
    add(b1);
    add(b2);
    add(b3);
    setSize(350, 100);
    setVisible(true);
  }
}

