Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save codenameone/8abb07271bae62d0f81a to your computer and use it in GitHub Desktop.
Save codenameone/8abb07271bae62d0f81a to your computer and use it in GitHub Desktop.
Usage of the Codename One EventDispatcher class to fire/manager event listeners
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);
}
@codenameone
Copy link
Author

Sample usage of EventDispatcher.

From the Codename One project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment