Javatpoint Logo
Javatpoint Logo

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().

actionPerformed() method

The actionPerformed() method is invoked automatically whenever you click on the registered component.

Java ActionListener Example: On Button click

Output:

java awt button example 2
Next TopicJava MouseListener




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


B.Tech / MCA