Java Event Handling Question and Answers

9. What is the highest level event class of the event delegation model?
  The java.util.EventObject class is the highest level class in the event delegation class hierarchy.
 
Your Name Your Email-ID
Your Answer
10. How can a GUI component handle its own events?
  A component can handle its own events by implementing the required event listener interface and adding itself as its own event listener.
 
Your Name Your Email-ID
Your Answer
11. What is the difference between the JDK 1.02 event model and event delegation model introduced with JDK 1.1?
 
  • The JDK 1.02 event model use an event inheritance or bubbling approach.
  • In this model, components are required to handle their own events.
  • If they do not handle a particular event, the event is inherited by (or bubbled up to) the components container and so on, until the highest level container has been tried.
  • In the event delegation model, specific objects are designated as event handlers for GUI components.
  • These objects implement event listener interfaces.
  • The event delegation model is more efficient than the event inheritance model because it eliminates the processing required to support the bubbling of unhandled events.
 
Your Name Your Email-ID
Your Answer
12. What is the relationship between a method's throw clause and the exceptions that can be thrown during the method's execution?
  A method's throws clause must declare any checked exceptions that are not caught within the body of the method.
 
Your Name Your Email-ID
Your Answer
123 Page 3 of 3