Thursday, February 12, 2009

Can a class be it’s own event handler Explain how to implement this

Question :Can a class be it’s own event handler? Explain how to implement this?
Answer :Sure. an example could be a class that extends Jbutton and implements ActionListener. In the actionPerformed method, put the code to perform when the button is pressed.

No comments: