var fDesc=new Array(); fDesc[0] = "Multiple listeners can register to be notified of events of a particular type from a particular source. Also, the same listener can listen to notifications from different objects.
Each event is represented by an object that gives information about the event and identifies the event source. Event sources are often components or models, but other kinds of objects can also be event sources.
Whenever you want to detect events from a particular component, first check the how-to section for that component. A list of the component how-to sections is here. The how-to sections give examples of handling the events that you are most likely to care about. In How to Use Color Choosers, for instance, you will find an example of writing a change listener to track when the color changes in the color chooser.

The following example demonstrates that event listeners can be registered on multiple objects and that the same event can be sent to multiple listeners. The example contains two event sources (JButton instances) and two event listeners. One of the event listeners (an instance of a class called MultiListener) listens for events from both buttons. When it receives an event, it adds the event's "action command" (which is set to the text on the button's label) to the top text area. The second event listener (an instance of a class called Eavesdropper) listens for events on only one of the buttons. When it receives an event, it adds the action command to the bottom text area."; function tShowHide(id, show) { var s = document.getElementById("desc"); if ((s.innerHTML.length<=212 || show==1) && show!=2) { s.innerHTML = fDesc[id]; if (document.getElementById('m1')) document.getElementById('m1').style.display='none'; if (document.getElementById('m2')) document.getElementById('m2').style.display='none'; if (document.getElementById('more_txt')) document.getElementById('more_txt').style.display='inline'; } else { s.innerHTML = ''; } }