Podcast
Questions and Answers
What method in the MouseEvent class returns the number of mouse clicks associated with the event?
What method in the MouseEvent class returns the number of mouse clicks associated with the event?
Which MouseEvent event method provides the x-position of the event relative to the source component?
Which MouseEvent event method provides the x-position of the event relative to the source component?
In the JList Class, what is used to construct a JList object?
In the JList Class, what is used to construct a JList object?
Which MouseEvent method returns which, if any, of the mouse buttons has changed state?
Which MouseEvent method returns which, if any, of the mouse buttons has changed state?
Signup and view all the answers
What type of event serves as an indication that the mouse pointer has exited a component?
What type of event serves as an indication that the mouse pointer has exited a component?
Signup and view all the answers
Which method would you use to find the largest selected cell index in a JList?
Which method would you use to find the largest selected cell index in a JList?
Signup and view all the answers
When would you use the method setSelectedIndex(int index) in a JList?
When would you use the method setSelectedIndex(int index) in a JList?
Signup and view all the answers
Which type of JScrollPane constructor would you need if you want to create a JScrollPane with both horizontal and vertical scroll bars that appear when needed, but start empty?
Which type of JScrollPane constructor would you need if you want to create a JScrollPane with both horizontal and vertical scroll bars that appear when needed, but start empty?
Signup and view all the answers
What does the method isSelectionEmpty() return when nothing is selected in a JList?
What does the method isSelectionEmpty() return when nothing is selected in a JList?
Signup and view all the answers
Which JList method would you use to determine whether single-item or multiple-item selections are allowed?
Which JList method would you use to determine whether single-item or multiple-item selections are allowed?
Signup and view all the answers
In a JList, what does the method getFirstVisibleIndex() return?
In a JList, what does the method getFirstVisibleIndex() return?
Signup and view all the answers
Which method is not invoked when the mouse button has been clicked on a component?
Which method is not invoked when the mouse button has been clicked on a component?
Signup and view all the answers
Which method is invoked when the mouse cursor has been moved onto a component but no buttons have been pressed?
Which method is invoked when the mouse cursor has been moved onto a component but no buttons have been pressed?
Signup and view all the answers
Which static int of MouseEvent class indicates no mouse buttons?
Which static int of MouseEvent class indicates no mouse buttons?
Signup and view all the answers
Which interface includes all the methods in both the MouseListener and MouseMotionListener interfaces?
Which interface includes all the methods in both the MouseListener and MouseMotionListener interfaces?
Signup and view all the answers
Which method is invoked when the mouse button is pressed on a component and then dragged?
Which method is invoked when the mouse button is pressed on a component and then dragged?
Signup and view all the answers
Which method is not invoked when the mouse button is released on a component?
Which method is not invoked when the mouse button is released on a component?
Signup and view all the answers
What is a requirement for the class of an object that responds to an event?
What is a requirement for the class of an object that responds to an event?
Signup and view all the answers
What does the getModifiers() method of the MouseEvent class return?
What does the getModifiers() method of the MouseEvent class return?
Signup and view all the answers
Which interface provides methods named mouseDragged() and mouseMoved()?
Which interface provides methods named mouseDragged() and mouseMoved()?
Signup and view all the answers
What is the purpose of the getSource() method of the EventObject class?
What is the purpose of the getSource() method of the EventObject class?
Signup and view all the answers
What does the getStateChange() method of the ItemEvent class return?
What does the getStateChange() method of the ItemEvent class return?
Signup and view all the answers
Which listener interface has methods named focusGained() and focusLost()?
Which listener interface has methods named focusGained() and focusLost()?
Signup and view all the answers
Which event type is generated when a button in a Swing GUI is clicked?
Which event type is generated when a button in a Swing GUI is clicked?
Signup and view all the answers
What is the parent class of all event objects in Java?
What is the parent class of all event objects in Java?
Signup and view all the answers
Which event listener is used to handle events generated from scroll bar movements?
Which event listener is used to handle events generated from scroll bar movements?
Signup and view all the answers
What method gets executed in response to the generated events in an event listener object?
What method gets executed in response to the generated events in an event listener object?
Signup and view all the answers
Which event type is generated when text is entered into a text field in a Swing GUI?
Which event type is generated when text is entered into a text field in a Swing GUI?
Signup and view all the answers
Which event listener is used to handle events generated from text field gaining or losing focus?
Which event listener is used to handle events generated from text field gaining or losing focus?
Signup and view all the answers