Maybe a datagram just arrived from the network. Maybe a sensor has detected that someone's just come in the back door. All of these occurrences can be modeled as events, and information about what happened can be included in the event. In a windowing system, for example, there might be a subtype of event for mouse clicks. The code that handles the event is called, strangely enough, the event handler .
Events are the primary way that Beans communicate with each other.
As we'll see below, if you choose events and their connections judiciously, you can interconnect Beans in your application, tell each Bean what to do in response to the events it cares about, and the application simply behaves . Each Bean minds its own business, responding appropriately to incoming events, and sending new events to interested neighboring Beans as new situations occur. Once you understand how to use events, you can write Beans that use them to communicate with other components. IDEs also can send events to and receive events from JavaBeans, essentially controlling them from the outside. In order to understand how events work with Beans, though, you've got to understand how they work in Java.