Multiple choice

The method used to arrange for a button to notify another object when it is clicked later is?

  1. addMouseListener

  2. addListener

  3. addObjectListener

  4. addActionListener

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In Java Swing, the ActionListener interface is specifically designed to handle action events, such as clicking a button. The addActionListener method registers an object to receive these events.