![]() D) An anonymous inner class always uses the no-arg constructor from its superclass to create an instance. C) An anonymous inner class must implement all the abstract methods in the superclass or in the interface. B) An anonymous inner class must always extend a superclass or implement an interface, but it cannot have an explicit extends or implements clause. A) evt.isControlDown() B) evt.isMetaDown() C) evt.isShiftDown() D) evt.isAltDown()ġ0) Which of the following statements are true? (choose all that apply) A) An anonymous inner class is compiled into a class named OuterClassName$n.class. E) A source may have multiple listeners.ĩ) To detect whether the right button of the mouse is pressed, you use the method _ in the MouseEvent object evt. D) The listener object must be registered by the source object. C) Each event class has a corresponding listener interface. B) The listener object's class must implement the corresponding event-listener interface. A) a source object B) the EventObject class C) a listener object D) the Object class E) both source and listener objectĨ) Which of the following statements are true? (choose all that apply) A) A listener may listen for multiple sources. A) public void mouseExited(MouseEvent e) B) public void mouseEntered(MouseEvent e) C) public void mousePressed(MouseEvent e) D) public void mouseReleased(MouseEvent e) E) public void mouseClicked(MouseEvent e)ħ) The handler (e.g., actionPerformed) is a method in _. A) Invoke the component's requestFocus method to set focus on this component B) Implement the KeyListener interface for the component C) Override the isFocusTraversable method defined in the Component class to return true D) All of the above.Ħ) The listener's _ method is invoked after a mouse button is pressed (but not released yet). A) MouseMotionListener/MouseMotionAdapter B) WindowListener/WindowAdapter C) MouseListener/MouseAdapter D) ComponentListener/ComponentAdapterĥ) To enable a component to listen to keyboard events, you need to _. E) None of the above.Ĥ) To listen to mouse clicked events, the listener must implement the _ interface or extend the _ adapter. D) The actionPerformed method is not executed when you click the OK button, because no instance of Test is registered with jbtOK. C) The program has a runtime error because no listeners are registered with jbtOK. B) The program has a syntax error because no listeners are registered with jbtOK. Import java.awt.* import .* import javax.swing.* public class Test extends JFrame implements ActionListener A) The message "The OK button is clicked" is displayed when you click the OK button. A) ContainerListener B) MouseListener C) WindowListener D) FocusListener E) ActionListener (choose all that apply) A) JButton B) JLabel C) JPanelĢ) The interface _ should be implemented to listen for a button action event. Choose the one alternative that best completes the statement or answers the question. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |