Event Handling In Java — Part 2 MCQs with Explanations
Practice high-yield Programming & Software Development MCQs on Event Handling In Java — Part 2 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.
Questions
35
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
42 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
35
Verified Practice Questions
Interactive test mode with detailed academic worked solutions
Live Progress|0/35 answered
✓0 correct
✗0 wrong
0% score
🎉 Set complete! All 35 questions answered.
Question 1 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these constant value will change when the button at the end of scroll bar was clicked to increase its value?
Correct Answer: Option D — UNIT_INCREMENT
Detailed Academic Explanation:
UNIT_INCREMENT is the correct answer to “Which of these constant value will change when the button at the end of scroll bar was clicked to increase its value”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 2 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods are used to register a mouse motion listener?
Correct Answer: Option C — addMouseMotionListner()
Detailed Academic Explanation:
addMouseMotionListner() is the correct answer to “Which of these methods are used to register a mouse motion listener”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 3 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these events is generated when the window is closed?
Correct Answer: Option D — WindowEvent
Detailed Academic Explanation:
WindowEvent is the correct answer to “Which of these events is generated when the window is closed”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 4 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these packages contains all the classes and methods required for even handling in Java?
Correct Answer: Option D — java.awt.event
Detailed Academic Explanation:
java.awt.event is the correct answer to “Which of these packages contains all the classes and methods required for even handling in Java”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 5 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods can be used to know which key is pressed?
Correct Answer: Option B — getModifier()
Detailed Academic Explanation:
getModifier() is the correct answer to “Which of these methods can be used to know which key is pressed”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 6 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these events is generated when a button is pressed?
Correct Answer: Option A — ActionEvent
Detailed Academic Explanation:
ActionEvent is the correct answer to “Which of these events is generated when a button is pressed”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 7 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods can be used to know the type of focus change?
Correct Answer: Option C — isTemporary()
Detailed Academic Explanation:
isTemporary() is the correct answer to “Which of these methods can be used to know the type of focus change”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 8 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods will be invoked if a character is entered?
Correct Answer: Option C — keyTyped()
Detailed Academic Explanation:
keyTyped() is the correct answer to “Which of these methods will be invoked if a character is entered”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 9 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods can be used to determine the type of adjustment event?
Correct Answer: Option C — getAdjustmentType()
Detailed Academic Explanation:
getAdjustmentType() is the correct answer to “Which of these methods can be used to determine the type of adjustment event”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 10 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods is defined in MouseMotionAdapter class?
Correct Answer: Option A — mouseDragged()
Detailed Academic Explanation:
mouseDragged() is the correct answer to “Which of these methods is defined in MouseMotionAdapter class”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 11 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these events will be generated if we close an applet's window?
Correct Answer: Option D — WindowEvent
Detailed Academic Explanation:
WindowEvent is the correct answer to “Which of these events will be generated if we close an applet's window”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 12 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
MouseEvent is subclass of which of these classes?
Correct Answer: Option D — InputEvent
Detailed Academic Explanation:
InputEvent is the correct answer to “MouseEvent is subclass of which of these classes”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 13 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Event class is defined in which of these libraries?
Correct Answer: Option D — java.util
Detailed Academic Explanation:
java.util is the correct answer to “Event class is defined in which of these libraries”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 14 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these events is generated by scroll bar?
Correct Answer: Option D — AdjustmentEvent
Detailed Academic Explanation:
AdjustmentEvent is the correct answer to “Which of these events is generated by scroll bar”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 15 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these events is generated when the size of an event is changed?
Correct Answer: Option A — ComponentEvent
Detailed Academic Explanation:
ComponentEvent is the correct answer to “Which of these events is generated when the size of an event is changed”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 16 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods can be used to determine the type of event?
Correct Answer: Option A — getID()
Detailed Academic Explanation:
getID() is the correct answer to “Which of these methods can be used to determine the type of event”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 17 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods can be used to change location of an event?
Correct Answer: Option B — TranslatePoint()
Detailed Academic Explanation:
TranslatePoint() is the correct answer to “Which of these methods can be used to change location of an event”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 18 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these events is generated when computer gains or loses input focus?
Correct Answer: Option C — FocusEvent
Detailed Academic Explanation:
FocusEvent is the correct answer to “Which of these events is generated when computer gains or loses input focus”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 19 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods is used to get x coordinate of the mouse?
Correct Answer: Option A — getX()
Detailed Academic Explanation:
getX() is the correct answer to “Which of these methods is used to get x coordinate of the mouse”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 20 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these interfaces handles the event when a component is added to a container?
Correct Answer: Option B — ContainerListener
Detailed Academic Explanation:
ContainerListener is the correct answer to “Which of these interfaces handles the event when a component is added to a container”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 21 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods can be used to obtain the command name for invoking ActionEvent object?
Correct Answer: Option B — getActionCommand()
Detailed Academic Explanation:
getActionCommand() is the correct answer to “Which of these methods can be used to obtain the command name for invoking ActionEvent object”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 22 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods can be used to get reference to a component that was removed from a container?
Correct Answer: Option B — getchild()
Detailed Academic Explanation:
getchild() is the correct answer to “Which of these methods can be used to get reference to a component that was removed from a container”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 23 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these are integer constants defined in ActionEvent class?
Correct Answer: Option D — All of the mentioned
Detailed Academic Explanation:
All of the mentioned is the correct answer to “Which of these are integer constants defined in ActionEvent class”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 24 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these interfaces define four methods?
Correct Answer: Option A — ComponentListener
Detailed Academic Explanation:
ComponentListener is the correct answer to “Which of these interfaces define four methods”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 25 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
FocusEvent is subclass of which of these classes?
Correct Answer: Option A — ComponentEvent
Detailed Academic Explanation:
ComponentEvent is the correct answer to “FocusEvent is subclass of which of these classes”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 26 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods are used to register a keyboard event listener?
Correct Answer: Option C — addKeyListener()
Detailed Academic Explanation:
addKeyListener() is the correct answer to “Which of these methods are used to register a keyboard event listener”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 27 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these is a superclass of all Adapter classes?
Correct Answer: Option A — Applet
Detailed Academic Explanation:
Applet is the correct answer to “Which of these is a superclass of all Adapter classes”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 28 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these events is generated when the component is added or removed?
Correct Answer: Option B — ContainerEvent
Detailed Academic Explanation:
ContainerEvent is the correct answer to “Which of these events is generated when the component is added or removed”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 29 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods is used to obtain the object that generated a WindowEvent?
Correct Answer: Option B — getWindow()
Detailed Academic Explanation:
getWindow() is the correct answer to “Which of these methods is used to obtain the object that generated a WindowEvent”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 30 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these interfaces define a method actionPerformed()?
Correct Answer: Option C — ActionListener
Detailed Academic Explanation:
ActionListener is the correct answer to “Which of these interfaces define a method actionPerformed()”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 31 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods can be used to obtain the coordinates of a mouse?
Correct Answer: Option A — getPoint()
Detailed Academic Explanation:
getPoint() is the correct answer to “Which of these methods can be used to obtain the coordinates of a mouse”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 32 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods can be used to obtain the reference to the container that generated a ContainerEvent?
Correct Answer: Option D — getContainerEvent()
Detailed Academic Explanation:
getContainerEvent() is the correct answer to “Which of these methods can be used to obtain the reference to the container that generated a ContainerEvent”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 33 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these events will be notified if scroll bar is manipulated?
Correct Answer: Option C — AdjustmentEvent
Detailed Academic Explanation:
AdjustmentEvent is the correct answer to “Which of these events will be notified if scroll bar is manipulated”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 34 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these methods will respond when you click any button by mouse?
Correct Answer: Option D — all of the mentioned
Detailed Academic Explanation:
all of the mentioned is the correct answer to “Which of these methods will respond when you click any button by mouse”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
Question 35 of 35
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of these class is super class of all the events?
Correct Answer: Option A — EventObject
Detailed Academic Explanation:
EventObject is the correct answer to “Which of these class is super class of all the events”. This question is standard in competitive examination syllabi for Event Handling In Java.
💡Key Conceptual Anchor:Event Handling In Java
✓Link copied to clipboard
Continue Your Practice
Advance Html — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
💡Examiner's Advisory for Programming & Software Development
In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.