Id: action.tex,v 1.1 2003/12/18 23:41:09 joe Exp
Label top = new Label ("Top"); int status = 0; void update () { top.setText (Integer.toString (status)); } class Step implements ActionListener { int myself; public Step (int k) { myself = k; } public void actionPerformed (ActionEvent a) { status += myself; update (); } } Button b = new Button ( .. ); b.addActionListener (new Step (11));