NEW
Font size
WorksheetsEvent Handling Quiz
Total questions: 15
Worksheet time: 8mins
What is the most common type of event processed in GUI components?
Mouse Event
Action Event
Key Event
Item Event
Which interface is used to handle action events?
KeyListener
ItemListener
ActionListener
MouseListener
What method must be implemented to handle action events?
itemStateChanged
mouseClicked
actionPerformed
keyPressed
Which class is used to create a button in Java Swing?
ActionEvent
ButtonHandler
MouseEvent
JButton
What keyword is used to implement an interface in Java?
implements
extends
inherits
uses
Which event is generated when a user clicks a button?
Action Event
Item Event
Mouse Event
Key Event
What is the purpose of the addActionListener method?
To register a listener for action events
To create a new button
To trigger an action event
To remove a listener
Which interface handles mouse events?
ActionListener
MouseListener
MouseMotionListener
KeyListener
What type of event does the KeyListener interface handle?
Mouse Events
Key Events
Action Events
Item Events
Which method is NOT part of the MouseListener interface?
mouseClicked
mousePressed
mouseReleased
mouseTyped
What does the itemStateChanged method do?
Handles item selection changes
Handles mouse clicks
Handles window events
Handles key presses
Which class is used to create a frame in Java Swing?
Label
Frame
Button
JFrame
What is the purpose of the WindowListener interface?
To handle key events
To handle window events
To handle mouse events
To handle item events
Which method is called when a key is pressed?
keyPressed
keyClicked
keyTyped
keyReleased
What is the main purpose of event handling in GUI applications?
To create graphics
To manage user interactions
To store data
To connect to databases
