wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Event Handling Quiz

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What is the most common type of event processed in GUI components?

a)

Mouse Event

b)

Action Event

c)

Key Event

d)

Item Event

2.

Which interface is used to handle action events?

a)

KeyListener

b)

ItemListener

c)

ActionListener

d)

MouseListener

3.

What method must be implemented to handle action events?

a)

itemStateChanged

b)

mouseClicked

c)

actionPerformed

d)

keyPressed

4.

Which class is used to create a button in Java Swing?

a)

ActionEvent

b)

ButtonHandler

c)

MouseEvent

d)

JButton

5.

What keyword is used to implement an interface in Java?

a)

implements

b)

extends

c)

inherits

d)

uses

6.

Which event is generated when a user clicks a button?

a)

Action Event

b)

Item Event

c)

Mouse Event

d)

Key Event

7.

What is the purpose of the addActionListener method?

a)

To register a listener for action events

b)

To create a new button

c)

To trigger an action event

d)

To remove a listener

8.

Which interface handles mouse events?

a)

ActionListener

b)

MouseListener

c)

MouseMotionListener

d)

KeyListener

9.

What type of event does the KeyListener interface handle?

a)

Mouse Events

b)

Key Events

c)

Action Events

d)

Item Events

10.

Which method is NOT part of the MouseListener interface?

a)

mouseClicked

b)

mousePressed

c)

mouseReleased

d)

mouseTyped

11.

What does the itemStateChanged method do?

a)

Handles item selection changes

b)

Handles mouse clicks

c)

Handles window events

d)

Handles key presses

12.

Which class is used to create a frame in Java Swing?

a)

Label

b)

Frame

c)

Button

d)

JFrame

13.

What is the purpose of the WindowListener interface?

a)

To handle key events

b)

To handle window events

c)

To handle mouse events

d)

To handle item events

14.

Which method is called when a key is pressed?

a)

keyPressed

b)

keyClicked

c)

keyTyped

d)

keyReleased

15.

What is the main purpose of event handling in GUI applications?

a)

To create graphics

b)

To manage user interactions

c)

To store data

d)

To connect to databases