Professional Documents
Culture Documents
set2question
set2question
SANJIVANI K. B. P. POLYTECHNIC
Department of Computer Technology
KOPARGAON – 423601, DIST: AHMEDNAGAR
2023-2024
/64
Sub : AJP (22517) Pratice Test: [Unit III – Event Handling] Date : / /2023
Name : Course Code : CM-5-I
Roll No : Set : II
2. An event is generated whe the internal state of the event source is________
a. Not changed b. Changed c. Either changed or not d. None of these
10. _____________ is a superclass of TextField and TextArea classes that is used to create single-line or multiline textfields
respectively:
a. TextBox b. CheckBox c. TextComponent d. Choice
12. The Delegation Event Model defines a ______________ approach to handle events:
a. Logical b. Physical c. Both a & b d. None of these
13.Which of the following event is called when the user presses the mouse button?
a)onMouseMove b)onMouseOut c)onMouseDown d)onMouseOver
18.Which of these methods is used to obtain the object that generated a WindowEvent?
a)getMethod() b)getWindow() c)getWindowEvent() d)getWindowObject()
21.Which of these methods can be used to know the type of focus change?
a)typeFocus() b)typeEventFocus() c)isTemporary() d)isPermanent()
22.Which of these methods can be used to get reference to a component that was removed from a container?
a)getComponent() b)getchild() c)getContainerComponent() d)getComponentChild()
25.Which of these methods is used to obtain the object that generated a WindowEvent?
a.getMethod() b.getWindow() c.getWindowEvent() d.getWindowObject()
30.Which of these methods can be used to know the type of focus change?
a.typeFocus() b.typeEventFocus() c.isTemporary() d.isPermanent()
31.Which of these methods can be used to obtain the reference to the container that generated a ContainerEvent?
a.getContainer() b.getContainerCommand() c.getActionEvent() d.getContainerEvent()
37. How many mouse buttons are typically supported by the MouseListener interface?
a) 1 b) 2 c) 3 d) 4
38. What is the primary purpose of the MouseAdapter class in Java Swing?
a) To handle keyboard events
b) To handle window events
c) To provide default implementations of the MouseListener interface
d) To provide default implementations of the ActionListener interface
39. Which event is typically generated when the mouse pointer enters a component?
a) mouseClicked b) mouseEntered c) mousePressed d) mouseExited
40. Which listener interface should you use to respond to mouse drag events in Java Swing?
a) MouseAdapter b) MouseMotionListener c) ActionListener d) KeyListener
41. In Java Swing, what is the primary purpose of the actionPerformed() method?
a) Handling keyboard input
b) Handling mouse clicks
c) Handling button clicks and other action even
d) Handling window resizing
42. Which method is used to register anActionListener with a JButton in Java Swing?
a) addButtonListener() b) addActionEvent() c) addActionListener() d) addListenerToButton()
43. Which method returns the item where the event occurred ?
a. getItemSelectable() b. getItem() c. getStateChange() d. none of these
44. Which method returns the state change type which generated the event ?
a. getItemSelectable() b. getItem() c. getStateChange() d. none of these
45. In item event class which constant marks the last integer id for the range of item ?
a. LAST_Item b. Last_Item c. ITEM_LAST d. Item_last
46. Which method returns the item selectable object where this event originated ?
a. getItemSelectable() b. getItem() c. getStateChange() d. none of these
47. An event is generated when the internal state of the event source is ___________.
a. detected b. origin c. changed d. none of these
54. Which method from the following methods will respond when you click any button by mouse?
(a)mouseClicked() (b)mouseEntered() (c)mousePressed() (d)All of the mentioned
55. In Java, events are all the activities that occur between:
(a)The user (b) The application (c) Both (a) and (b) (d) None of the above
56. The constructor that is defined by the Text Event class is:
a. TextEvenet(Object source, int id ) b. textevent (Object source, int event_type )
c. textevent (object Source, float event_type) d. textevent (Object source, string event_type)
57. An event is generated when the internal state of the event source is
(a) Not changed (b) Changed (c) Either changed or not (d) None of these
58. When two or more objects are added as listeners for the same event, which listener is first
invoked to handle the event?
(a) The first object that was added as listener.
b) The last object that was added as listener.
(c) There is no way to determine which listener will be invoked first.
(d) It is impossible to have more than one listener for a given event.
60._______ generates action events when an item is double-clicked, generate action events when an item is selected or deselected.
a.List b. Check box c. Menu item d. Text box Label
64.. A source generates an event and sends it to ___________ listeners that can handle the event:
a. One b. Two c. One or more d. None of these