public interface Dispatcher
Dispatcher d = new Dispatcher() { public void dispatch(EventListener l, EventObject eventObj) { ((FooListener) l).fooXXX((FooEvent) eventObj); } }; FooEvent event = new FooEvent(this); dispatchQueue.dispatch(d, FooListener.class, event);In the above code substitute a specific listener and event for the Foo listener and event. Dispatchers can be reused, so it is a good idea to cache them to avoid unnecessary memory allocations.
Modifier and Type | Method and Description |
---|---|
void |
dispatch(java.util.EventListener l,
java.util.EventObject eventObj)
Dispatch an event to a specified event listener.
|