FileDocCategorySizeDatePackage
EventListenerListEventSource.javaAPI DocExample915Mon Jan 09 11:02:02 GMT 2006None

EventListenerListEventSource

public class EventListenerListEventSource extends TestEventSource

Fields Summary
EventListenerList
listenerList
Constructors Summary
Methods Summary
public voidaddListener(TestEventListener l)


         
        listenerList.add (TestEventListener.class, l);
    
public voidfireEvent(java.util.EventObject o)

        Object[] listeners = listenerList.getListenerList();
        for (int i = listeners.length-2; i>=0; i-=2) {
            if (listeners[i] == TestEventListener.class) {
                ((TestEventListener) listeners[i+1]).handleEvent(o);
            }
        }
    
public static voidmain(java.lang.String[] args)

        EventListenerListEventSource bfles = 
            new EventListenerListEventSource();
        bfles.test();
    
public voidremoveListener(TestEventListener l)

        listenerList.remove (TestEventListener.class, l);