wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Java AWT Event Model Quiz

Total questions: 23

Worksheet time: 12mins

Name
Class
Date
1.

The Delegation Event Model was introduced in which version of Java?

a)

Java 1.0

b)

Java 1.1

c)

Java 1.2

d)

Java 1.5

2.

In the Delegation Event Model, an event is generated by:

a)

Listener

b)

Event Handler

c)

Event Source

d)

Adapter

3.

Which interface must be implemented to handle button click events in AWT?

a)

MouseListener

b)

KeyListener

c)

ActionListener

d)

WindowListener

4.

Which method is used to register a listener with an event source?

a)

addEvent()

b)

registerListener()

c)

addListener()

d)

addXxxListener()

5.

Which of the following is an example of an event source?

a)

ActionEvent

b)

Button

c)

ActionListener

d)

MouseEvent

6.

Which package contains AWT event classes and listener interfaces?

a)

java.io

b)

java.lang

c)

java.awt

d)

java.awt.event

7.

What is the role of a listener in the Delegation Event Model?

a)

To generate events

b)

To handle events

c)

To create GUI components

d)

To register events

8.

Which of the following is NOT a component of the Delegation Event Model?

a)

Event Source

b)

Event Listener

c)

Event Object

d)

Event Loop

9.

What happens if no listener is registered for an event source?

a)

Event is handled automatically

b)

Program crashes

c)

Event is ignored

d)

Event is queued

10.

Which class is used to create a top-level window in AWT?

a)

Window

b)

Panel

c)

Frame

d)

Dialog

11.

Which package contains the Frame class?

a)

java.io

b)

java.util

c)

java.awt

d)

java.swing

12.

Which of the following is a default layout manager for a Frame?

a)

FlowLayout

b)

GridLayout

c)

BorderLayout

d)

CardLayout

13.

Which method is used to make a Frame visible?

a)

display()

b)

show()

c)

setVisible(true)

d)

enable()

14.

Which constructor creates a Frame with a title?

a)

Frame()

b)

Frame(String title)

c)

Frame(int width, int height)

d)

Frame(boolean visible)

15.

Which method is used to set the size of a Frame?

a)

resize()

b)

setSize()

c)

setBounds()

d)

Both B and C

16.

Which method is used to close a Frame when the close button is clicked?

a)

setVisible(false)

b)

dispose()

c)

System.exit(0)

d)

Using WindowListener

17.

Which event is generated when a Frame is closed?

a)

ActionEvent

b)

MouseEvent

c)

WindowEvent

d)

KeyEvent

18.

Which interface is implemented to handle Frame window events?

a)

ActionListener

b)

MouseListener

c)

WindowListener

d)

KeyListener

19.

Which method is used to set the layout of a Frame?

a)

setLayout()

b)

addLayout()

c)

changeLayout()

d)

layout()

20.

Which package contains layout managers in Java?

a)

. java.lang

c)

java.swing

d)

java.awt

21.

Which layout manager arranges components in rows, left to right?



a)

A. BorderLayout

b)

B. GridLayout

c)

C. FlowLayout

d)

D. CardLayout

22.

Which layout manager allows switching between different components like cards?




a)

A. FlowLayout

b)

B. BorderLayout

c)

C. GridLayout

d)

D. CardLayout

23.

Which layout manager has regions like North, South, East, West, and Center?




a)

A. GridLayout

b)

B. FlowLayout

c)

C. BorderLayout

d)

D. CardLayout