JavaHow Does Java Event Handling Work? Think Wedding Gifts

How Does Java Event Handling Work? Think Wedding Gifts

Developer.com content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

A good understanding of the Java event-handling mechanism is essential for any Java programmer. Event-based Java programming isn’t limited just to GUI Swing programs; you also will find it in applications that use Java technologies such as servlets and message-driven beans.

In his JavaBoutique.com tutorial, Gurunath Kalamadi breaks down the event-handling concept with concise explanations and practical examples. He really brings the lesson home with a novel analogy for event handling: a group of friends deciding what gifts to bring to their friend’s wedding.

Consider four friends: A, B, C and D. Suppose the event is A is getting married. A’s friends, B, C and D, want to respond to this event. The response protocol is to attend the wedding and bring a gift for A. They all must adhere to the response protocol, but they are free to choose the gift they bring.


Read the entire tutorial at Java Boutique:
Java Programming Basics: Event Handling

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Latest Posts

Related Stories