CSE 8B Chapter 15.1 - 15.6: Intro, Events and Event Sources, Registering Handlers and Handling Events, Inner Classes, Anonymous Inner Classes, Lambda Expression

83 views3 pages

Document Summary

It is possible to write code to process events. Eg. to respond to a button clock, you must write code to process button-clicking action: button event source object (where action comes from, event handler object capable of handling action event on the button. To be a handler of an action event: object must be instance of eventhandler interface, eventhandler object handler must be registered to event source object via source. setonaction(handler) Eventhandler interface contains handle(actionevent) method to process action event. Event object created from event source: firing event means creating an event and picking handler to handle event. Event object contains properties relevant to event. User does something to source object eventtype is created. Handler object that must be registered with an event source object: must be an instance of appropriate event-handling interface. Handler must be an instance of corresponding eventhandler interface. A source object must register the handler.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents