OO Programming with Java


Events

  1. Sample use:
public static void main(String[] args) {
  Timer timer = new Timer();
  timer.addTimerListener(new TimerListener() {
    public void tic(TimerEvent e) {
      System.out.println("tic");
    }});
  timer.start();
}

Compare the code with the previous one.

source


9 - 12