Id: event.tex,v 1.1 2003/12/04 12:39:55 joe Exp
public class Counter { ... Button inc = new Button ("inc"); class Inc_L implements ActionListener { public void actionPerformed (ActionEvent a) { status++; update (); } } public void init () { ... add (inc); inc.addActionListener (new Inc_L ()); } }Aufgaben: füge Knöpfe für decrement und reset hinzu.