Created
February 29, 2016 05:08
-
-
Save codenameone/8abb07271bae62d0f81a to your computer and use it in GitHub Desktop.
Usage of the Codename One EventDispatcher class to fire/manager event listeners
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private final EventDispatcher listeners = new EventDispatcher(); | |
public void addActionListener(ActionListener a) { | |
listeners.addListener(a); | |
} | |
public void removeActionListener(ActionListener a) { | |
listeners.removeListener(a); | |
} | |
private void fireEvent(ActionEvent ev) { | |
listeners.fireActionEvent(ev); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sample usage of EventDispatcher.
From the Codename One project