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);
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);
Step by Step Solution
3.46 Rating (166 Votes )
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
