import java.awt.*;
import java.awt.event.*;
public class ButtonTestC {
public static void main (String [] args) {
Frame f = new Frame ();
Button b = new Button ("Exit");
f.setSize (400, 400);
f.setLocation (100, 100);
f.setVisible (true);
f.add (b);
AL al = new AL ();
b.addActionListener (al);
}
public static class AL implements ActionListener {
AL () {}
@Override
public void actionPerformed (ActionEvent e) {
System.exit (0);
}
}
}