A JFrame contains a JButton named button1 that should execute an actionPerformed() method when clicked. Which statement

Question:

A JFrame contains a JButton named button1 that should execute an actionPerformed() method when clicked. Which statement is needed in the JFrame class?
a. addActionListener(this);
b. addActionListener(button1);
c. button1.addActionListener(this);
d. this.addActionListener(button1);

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Java Programming

ISBN: 978-1337397070

9th edition

Authors: Joyce Farrell

Question Posted: