Are event handler, event listener, and event registration all referring to the same thing?

后端 未结 3 1784
盖世英雄少女心
盖世英雄少女心 2021-01-05 00:06

If not, what is their difference?

相关标签:
3条回答
  • 2021-01-05 00:36

    The Event Handler is the method that gets called to handle the Event.

    The Event Listener is the mechanism that listens for the Event to happen. It then calls the Event Handlers.

    Event Registration is the process by which an Event Handler gets registered with an Event Listener so that the handler is called when the Event Listener fires the event.

    0 讨论(0)
  • 2021-01-05 00:38

    Event handlers and event listeners both mean functions that respond to events.
    In Java, an event listener is a (frequently anonymous) class which implements a Listener interface to handle an event)

    Event registration is the process of registering handlers to handle events.

    0 讨论(0)
  • 2021-01-05 00:50

    The listener is the object that receives notification, the handler is the method that actually handles the notification. Registration means to register a new listener to the event source.

    0 讨论(0)
提交回复
热议问题