public class EventUtils
extends java.lang.Object
Constructor and Description |
---|
EventUtils() |
Modifier and Type | Method and Description |
---|---|
static <L> void |
addEventListener(java.lang.Object eventSource,
java.lang.Class<L> listenerType,
L listener)
Adds an event listener to the specified source.
|
static <L> void |
bindEventsToMethod(java.lang.Object target,
java.lang.String methodName,
java.lang.Object eventSource,
java.lang.Class<L> listenerType,
java.lang.String... eventTypes)
Binds an event listener to a specific method on a specific object.
|
public static <L> void addEventListener(java.lang.Object eventSource, java.lang.Class<L> listenerType, L listener)
L
- the event listener typeeventSource
- the event sourcelistenerType
- the event listener typelistener
- the listenerjava.lang.IllegalArgumentException
- if the object doesn't support the listener typepublic static <L> void bindEventsToMethod(java.lang.Object target, java.lang.String methodName, java.lang.Object eventSource, java.lang.Class<L> listenerType, java.lang.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 © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"