Java ActionListener Interface
The Java ActionListener is notified whenever you click on the button or menu item. It is notified against ActionEvent. The ActionListener interface is found in java.awt.event package. It has only one method: actionPerformed().
The actionPerformed() method is invoked automatically whenever you click on the registered component.
Java ActionListener Example: On Button click