Consider the following code snippet: class MouseClickedListener implements ActionListener
{
Public void mouseClicked(MouseEvent event)
{
Int x = event.getX() ;
Int y = event.getY() ;
Component.moveTo(x,y) ;
}
}
What is wrong with this code?
A) The mouseClicked method cannot access the x and y coordinates of the mouse.
B) repaint() method was not called.
C) The class has implemented the wrong interface.
D) There is nothing wrong with this code.
Correct Answer:
Verified
Q75: A(n) _ has an instance method addActionListener()
Q76: How do you specify what the program
Q77: Use the _ method to add a
Q78: If the user presses and releases a
Q79: You have a class which extends the
Q80: Assuming that the ClickListener class implements the
Q82: A/an _ is used to capture mouse
Q83: You wish to detect when the mouse
Q84: Consider the following code snippet: public class
Q85: What does the MouseAdapter class provide?
A) MouseAdapter
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents