I am trying to write an AbstractAction class which waits for a mouse click event and then processes the Object clicked. Is there a relatively simple way to do this?
Also, if the user clicks the wrong type of object, would like to ask the user to try again.
private class MyAction extends AbstractAction implements EventListener {
MyAction() {
super("Do something...");
}
/**
*
*/
public void actionPerformed(ActionEvent arg0) {
// Wait for User to click to select Object
Object o = ...;
// Do something with object that was clicked/selected
}
}