Hi
I have a class like this:
public class ButtonToSpriteLibraryAdaptor implements EventListener {
SpriteLibraryModel model;
Button controller;
public ButtonToSpriteLibraryAdaptor(Button component, SpriteLibraryModel m) {
model = m;
controller = component;
}
public void actionPerformed(ActionEvent arg0) {
model.addSprite();
}
}
Now ofcourse because of the class name it looks like this class’s specific function is supposed to happen
when a button is clicked. But what if I want to make it general? I want to be able to register any gui component or object and listen for events.
How can I do this? is there any interface i can implement to get a basic event from any gui component?
If i name the class ActionToSpriteLibraryNewSprite then maybe you understand what i want the class to do. Or maybe I just have to implement many different
listener interfaces to support different components?
