When the user clicks a JCheckBox an occurs A CheckedEvent B
When the user clicks a JCheckBox, a(n) _________ occurs.
A) CheckedEvent
 B) ButtonEvent
 C) ItemEvent
 D) ActionEvent
37.
The logical relationship between radio buttons is maintained by objects of what class?
A) MutualExclusionGroup
 B) RadioButtonGroup
 C) Group
 D) ButtonGroup
38.
When the arrow on a JComboBox is clicked:
A) an ItemEvent occurs
 B) a scrollbar always appears
 C) an ActionEvent occurs
 D) The JComboBox expands to a list
39.
The setMaximumRowCount method is used for:
A) Button
 B) JComboBox
 C) JRadioButton
 D) JToggleButton
40.
Which of the following statements about anonymous inner classes is false?
A) They are declared without a name.
 B) They typically appear inside a method declaration.
 C) They are declared with the anonymous keyword.
 D) They can access their top-level class’s members.
41.
Selecting a JList item generates:
A) an ActionEvent
 B) a ListItemEvent
 C) a ListSelectionEvent
 D) a ListSelectionItemEvent
42.
Method getSelectedValues of class JList returns:
A) an array of ints representing the indices of the selected items.
 B) an array of doubles representing the indices of the selected items.
 C) an array of Strings representing the selected items.
 D) an array of Objects representing the selected items.
43.
Which of the following is a MouseMotionListener method?
A) mousePressed
 B) mouseExited
 C) mouseDragged
 D) mouseClicked
44.
A MouseHandler object implements which two interfaces?
A) MouseListener and MouseActionListener
 B) MouseListener and MouseMotionListener
 C) MouseListener and MouseEventListener
 D) MouseListener only
45.
In what cases are adapter classes useful?
A) When an adapter GUI control is clicked.
 B) When every method in the event-listener interface is to use the same functionality.
 C) When it is not desirable to declare every method in the event-listener interface.
 D) None of the above.
46.
Method paintComponent is called when:
A) a lightweight Swing component is created.
 B) a lightweight Swing component is displayed.
 C) a lightweight Swing component is clicked.
 D) an application exits.
47.
Class Point represents:
A) a filled oval
 B) an x-y coordinate
 C) an object used to draw
 D) a period in a sentence
48.
Method ________ indicates that a Component should be refreshed on screen as soon as possible with a call to that control’s paintComponent method.
A) refresh
 B) repaint
 C) repaintComponent
 D) redraw
49.
Which layout manager is the default for JFrame?
A) FlowLayout
 B) BorderLayout
 C) GridLayout
 D) None of the above
50.
Each container can have:
A) only one layout manager
 B) one or more layout managers
 C) zero or more layout managers
 D) only one or two layout managers
Solution
36) The correct answer is D) ActionEvent
 Explanation :
 When user clicks on the JCheckBox control,
 the ActionEvent is performed.
37)The correct answer is D) ButtonGroup
 Explanation :
 The ButtonGroup is not a component of the GUI
 and it organises the radio buttons added to it
 and individual radio buttons can be added to the components
 of GUI.
38)The correct answer is A)an ItemEvent occurs
 Explanation :
 When an item on the JComboBox is selected then the ItemEvent occurs
 that implements the method itemStateChanged method .
39)The correct answer is B)JComboBox
 Explanation :
 The method setMaximumRowCount is used to set the maximum
 number of items to display when an arrow is clicked on the
 combo box.
40)The correct answer is C)The are declared with the anonymous keyword.
41)The correct answer is C)a ListSelectionEvent
 Explanation :
 When user selects an element in the JLIst then
 aListSelectionEvent generates ListSelectionListener
 to handle the the JList selection.
42)The correct answer is D) an array of Objects representing the selected items.
43) The correct option is C)MouseDragged
 Explanation :
 The MouseMotionListener method
 that implements two abstract methods
 mouseMoved and mouseDragged.
 So mouseDragged is the correct option.
44)The correct option is B) MouseListener and MouseMotionListener
 Explanation:
 MouseHandler object implements two interface .
 The interfaces are MouseHandler object implements two interface .
45) The correc option is B) When every method in the event-listener interface is to use the same
functionality.
46)The correct option is C) a lightweight Swing component is clicked.
47) The correct option is B) an x-y coordinate
48) The correct option is B) repaint
49) The correct option is B) BorderLayout
50)The correct option A) only one layout manager




