Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

In the program below, which object is listening for the events of okButton? import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Quiz3B extends JFrame implements ActionListener {    private JButton okButton = new JButton(“OK”);    public Quiz3B()    {        add(okButton);        okButton.addActionListener(this);    }

Question 16 (5 points)

In the program below, which object is listening for the events of okButton?

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Quiz3B extends JFrame implements ActionListener
{
private JButton okButton = new JButton(“OK”);

public Quiz3B()
{
add(okButton);
okButton.addActionListener(this);
}

public void actionPerformed(ActionEvent e)
{
System.out.println(“The OK button is clicked”);
}

public static void main(String[] args)
{
JFrame frame = new Quiz3B();
frame.setSize(300, 300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}

Question 16 options:

JButton
frame
okButton
An anonymous object
 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"