NEW
Font size
WorksheetsJava AWT Event Model Quiz
Total questions: 23
Worksheet time: 12mins
The Delegation Event Model was introduced in which version of Java?
Java 1.0
Java 1.1
Java 1.2
Java 1.5
In the Delegation Event Model, an event is generated by:
Listener
Event Handler
Event Source
Adapter
Which interface must be implemented to handle button click events in AWT?
MouseListener
KeyListener
ActionListener
WindowListener
Which method is used to register a listener with an event source?
addEvent()
registerListener()
addListener()
addXxxListener()
Which of the following is an example of an event source?
ActionEvent
Button
ActionListener
MouseEvent
Which package contains AWT event classes and listener interfaces?
java.io
java.lang
java.awt
java.awt.event
What is the role of a listener in the Delegation Event Model?
To generate events
To handle events
To create GUI components
To register events
Which of the following is NOT a component of the Delegation Event Model?
Event Source
Event Listener
Event Object
Event Loop
What happens if no listener is registered for an event source?
Event is handled automatically
Program crashes
Event is ignored
Event is queued
Which class is used to create a top-level window in AWT?
Window
Panel
Frame
Dialog
Which package contains the Frame class?
java.io
java.util
java.awt
java.swing
Which of the following is a default layout manager for a Frame?
FlowLayout
GridLayout
BorderLayout
CardLayout
Which method is used to make a Frame visible?
display()
show()
setVisible(true)
enable()
Which constructor creates a Frame with a title?
Frame()
Frame(String title)
Frame(int width, int height)
Frame(boolean visible)
Which method is used to set the size of a Frame?
resize()
setSize()
setBounds()
Both B and C
Which method is used to close a Frame when the close button is clicked?
setVisible(false)
dispose()
System.exit(0)
Using WindowListener
Which event is generated when a Frame is closed?
ActionEvent
MouseEvent
WindowEvent
KeyEvent
Which interface is implemented to handle Frame window events?
ActionListener
MouseListener
WindowListener
KeyListener
Which method is used to set the layout of a Frame?
setLayout()
addLayout()
changeLayout()
layout()
Which package contains layout managers in Java?
Which layout manager arranges components in rows, left to right?
A. BorderLayout
B. GridLayout
C. FlowLayout
D. CardLayout
Which layout manager allows switching between different components like cards?
A. FlowLayout
B. BorderLayout
C. GridLayout
D. CardLayout
Which layout manager has regions like North, South, East, West, and Center?
A. GridLayout
B. FlowLayout
C. BorderLayout
D. CardLayout
