0% found this document useful (0 votes)
76 views1 page

Bt0074 Unit 9 Faqs

The document discusses event handling in Java, noting that it allows a program to wait for user actions and control the sequence of operations through a GUI. It defines an event object as data associated with a user interaction that is passed to the application, an event source as the object that generates an event like a button, and an event handler as a method that processes the event by taking the event object as a parameter. Finally, it describes an event listener as an object that delegates event handling to a listener which must implement the interface containing the event handling method.

Uploaded by

sreilal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views1 page

Bt0074 Unit 9 Faqs

The document discusses event handling in Java, noting that it allows a program to wait for user actions and control the sequence of operations through a GUI. It defines an event object as data associated with a user interaction that is passed to the application, an event source as the object that generates an event like a button, and an event handler as a method that processes the event by taking the event object as a parameter. Finally, it describes an event listener as an object that delegates event handling to a listener which must implement the interface containing the event handling method.

Uploaded by

sreilal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Frequently Asked Questions Subject Name: OOPS with Java Unit 9: Event Handling

Balasubramani R Assistant Professor Dept. of IT

Subject Code: BT0074

Q1: What is event-handling? A1: In event handling, the program waits for the user to perform some action. The user controls the sequence of operations that the application executes through a GUI. This approach is also called event-driven programming. Q2: What is an Event Object? A2: When the user interacts with the application by pressing a key or clicking a mouse button, an event is generated. The operating system traps this event and the data associated with it, for example, the time at which the event occurred, the event type (like a keypress or a mouseclick). This data is then passed on to the application to which the event belongs. Q3: What is an Event Source? A3: An Event Source is an object that generates an event. For example, if you click on a button, an ActionEvent object is generated. The object of the ActionEvent class contains information about the event. Q4: What is is an Event Handler? A4: An Event Handler is a method that understands the event and processes it. The Event Handler method takes an event object as a parameter. Q5: What is an Event Listener? A5: An object delegates the task of handling an event to the event listener. When an event occurs, an event object of the appropriate type is created. This object is passed to the listener. A listener must implement the interface that has the method for event-handling.

You might also like