%% -*- mode: latex; TeX-master: "informatik.tex"; -*-

\begin{slide}{ActionListener (Wiederholung)}

\kopf{$ $Id: action.tex,v 1.1 2006-10-09 13:24:18 waldmann Exp $ $}

\begin{verbatim}
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));
\end{verbatim}

\end{slide}
