public class EventUtils extends Object
Constructor and Description |
---|
EventUtils() |
Modifier and Type | Method and Description |
---|---|
static <L> void |
addEventListener(Object eventSource,
Class<L> listenerType,
L listener)
Adds an event listener to the specified source.
|
static <L> void |
bindEventsToMethod(Object target,
String methodName,
Object eventSource,
Class<L> listenerType,
String... eventTypes)
Binds an event listener to a specific method on a specific object.
|
public static <L> void addEventListener(Object eventSource, Class<L> listenerType, L listener)
L
- the event listener typeeventSource
- the event sourcelistenerType
- the event listener typelistener
- the listenerIllegalArgumentException
- if the object doesn't support the listener typepublic static <L> void bindEventsToMethod(Object target, String methodName, Object eventSource, Class<L> listenerType, String... eventTypes)
L
- the event listener typetarget
- the target objectmethodName
- the name of the method to be calledeventSource
- the object which is generating events (JButton, JList, etc.)listenerType
- the listener interface (ActionListener.class, SelectionListener.class, etc.)eventTypes
- the event types (method names) from the listener interface (if none specified, all will be
supported)Copyright © 2001–2021 The Apache Software Foundation. All rights reserved.