public void removeAllListeners() { 
    Object[] listenerArray = listeners.getListenerList();
    for (int i = 0, size = listenerArray.length; i < size; i += 2) {
      listeners.remove((Class)listenerArray[i], 
        (EventListener)listenerArray[i+1]);
    }
  }