The first example simply allows Events to bubble up to the Applet panel where processing takes place. As in the Visual Kiosk example of the previous section, the price that is paid is in the complexity of the Event processing logic. As the Applet panel gets more complex, so the the logic of action().
The second example uses the "Observer" design . Button is subclassed, overriding, action(). The Applet panel is passed to the subclass in its constructor. It is, then, possible to setText() the result TextField in the Button subclass. Note that, as written, there is no interactions between the various Buttons.
The third example uses the new Event model. Notice that the logic of ActionButton and ActionTextField do not need to be altered when, say, one adds more choices. Of course, all "Listener"s must be explicitly "Add"ed.
The fourth example also uses the new Event model.