Event Handling and GUI Programming
Event Handling and GUI Programming
Programming
Event Handling mechanism, Event Delegation, Event and KeyEvent Classes, Event
Listener
Interfaces. GUI Programming with JavaFX: UI Controls, Layout Classes, Collection
Classes,
Media Classes.
EVENTS
• EVENTS FROM GRAPHICAL USER INTERFACE
• There are several types of events, including those generated by the mouse, the
keyboard, and various GUI controls, such as a push button, scroll bar, or check
box.
• OTHER EVENTS
• When a timer expires
• A counter exceeds a value,
• A software or hardware failure occurs, or an operation is completed.
• You are free to define events that are appropriate for your application.
Event Handling
SOURCES
Subclasses of
Component in AWT EVENTS
Subclasses of EventObject
LISTENERS
Implement interfaces to
generate respond to events
For AWTEvents listener
interfaces are in
java.awt.event package
Event User Interface Components that generates Events
sources
• MouseMotionListener Interface
Implementing MouseListener
Implementing MouseMotionListener
Initialising the Application