Multiple Choice
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
Correct Answer:
Verified
Q6: Suppose a JPanel with a BorderLayout manager
Q6: A complex GUI can be created with
Q10: Which of the following adds a border
Q21: What is the easiest way to create
Q22: _ are round and have a black
Q24: A _ is a user-interface component with
Q35: How do you add two buttons to
Q40: Which layout manager places objects left-to-right, and
Q46: When the user selects a menu item,
Q67: When method makeMenuItem is called, how many