Java has always used event based programming to deal with user interfaces. Initially would generate events and send them to components. The component would information the system whether it processed the event. If so, that was the end of the processing. Otherwise the system would forward the event to another component, and so on until one did process the event.
By the time Java 1.1 was released, event processing had changed. A new delegation model was adopted which implements the observer pattern. Any components interested in an event implement a listener interface. They register with the system to handle the event. This makes the system's job easier. When the event fires, all listeners registered for that event get notified. More than one component can receive and process the event.
If your component's event processing is going to take any real time, you should do the work in a separate worker thread to keep the system responsive for the user.
Customer Sales Starts With Respect - I sold my old car recently. After turning in the license plates, I called my insurance company to cancel the insurance on the car. They said they could al...
3 days ago