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