question archive Consider the following Java program
Subject:Computer SciencePrice:2.87 Bought7
Consider the following Java program. Which one of the following does NOT describe "MouseWhisperer"?
import java.awt.event.*;
import javax.swing.*;
public class MouseWhisperer extends JFrame implements MouseListener {
MouseWhisperer() {
super("COME CLOSER");
setSize(300,100);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
addMouseListener(this);
setVisible(true);
}
public void mouseClicked(MouseEvent e) { setTitle("OUCH"); }
public void mousePressed(MouseEvent e) { setTitle("LET GO"); }
public void mouseReleased(MouseEvent e) { setTitle("WHEW"); }
public void mouseEntered(MouseEvent e) { setTitle("I SEE YOU"); }
public void mouseExited(MouseEvent e) { setTitle("COME CLOSER"); }
public static void main(String[] args) { new MouseWhisperer(); }
}
Select one:
a. A "MouseWhisperer" object can be assigned to a "JFrame" variable.
b. A "MouseWhisperer" object listens for action events.
c. A "MouseWhisperer" object responds to mouse clicks.
d. A "MouseWhisperer" object responds to mouse movement.
e. The "MouseWhisperer" class can be run as a program.
Purchased 7 times