Summary

This chapter has covered the delegation-based event model that supersedes the inheritance-based model that came with the original AWT. Although the original event model was sufficient for applets (and applications) with simple event handling needs, it did not scale well for a number of reasons (see “Shortcomings of the Inheritance-Based Event Model”). The new event model addresses nearly all of the drawbacks of the original event model while maintaining compatibility, at least for the time being, with the old model.

We've explored many of the aspects of the new event model in this chapter: events, components, and listeners, along with semantic events, consuming events, firing standard and custom events from custom components, etc.

While ...

Get Graphic Java™ 1.2, Volume I: AWT, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.