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 Quiz3C extends JFrame {    private JButton okButton = new JButton(“OK”);    public Quiz3C()    {

Question 18 (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 Quiz3C extends JFrame
{
private JButton okButton = new JButton(“OK”);

public Quiz3C()
{
add(okButton);
okButton.addActionListener(
new ActionListener()
{
@Override
public void actionPerformed(ActionEvent ae)
{
System.out.println(“The OK button is clicked”);
}
});
}
public static void main(String[] args)
{
JFrame frame = new Quiz3C();
frame.setSize(300, 300);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}

Question 18 options:

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