previous | start | next

## Change Listeners

- Use standard ChangeListener interface type
  public interface ChangeListener
  {
  void stateChanged(ChangeEvent event);
  }
- Invoice collects ArrayList of change listeners
- When the invoice changes, it notifies all listeners:
  ChangeEvent event = new ChangeEvent(this);
  for (int i = 0; i < listeners.size(); i++)
  {
  ChangeListener listener = (ChangeListener)listeners.get(i);
  listener.stateChanged(event);
  }

previous | start | next