I gave up on the GUI Builders for Java and now I develop 'em completely in code (not really very hard, with a couple of hours of practice). Now I am tackling event handling.
But I find that when I try to use a class to implement a type of listener, e.g.
private class TextAction implements FocusListener
{
public void focusGained(FocusEvent e)
{
responseTxt.setText("Got focus");
}
public void focusLost(FocusEvent e)
{
}
}
I must supply an empty action handler (as above) for focusLost, even if I don't need it, or I get a nastygram from the editor saying this is not an abstract class and does not override the FocusLost method, etc.
Does this mean that action handlers must show an action handler for each event type associated with the listener, even when the action will not be used in the program?
Thanks for any help on this.