What are Listeners and Event sources? Explain at least five Listener interfaces and Event Sources briefly.

Event sources

 Almost all GUI components except few exceptions generate one or more types of events. The table below lists some of the event sources that can generate events.


An event source must be registered into listeners in order for the listeners to receive notifications about a specific type of event. We use addTypeListener(TypeListener el) method for this registration. Here, Type is the name of the event, and el is a reference to the event listener. For example, the method that registers a keyboard event listener is called addKey Listener().

EVENT LISTENER INTERFACES

To handle events we must implement event listener interfaces. It has two major requirements. First, it must have been registered with one or more sources to receive notifications about specific types of events. Second, it must implement methods to receive and process these notifications. The event listener interfaces and their corresponding method declarations are given below.






Comments

Popular posts from this blog

Explain CORBA architecture briefly.

Explain the architecture of data mining system with block diagram./Describe the Data Mining Architecture with figure.

Describe management functions and explain how each of them is interrelated./ Four key functions (planning, organizing, directing and controlling) make up the process of management. It is possible that the controlling function can affect the organizing function and organizing function can affect the leading functions? Explain.