Peers and Platform Independence

As the programming interface for applet and graphical application development, the AWT provides a generalized set of classes that can be used without concern for platform-specific windowing issues. This feature is made possible by a set of AWT classes known as peers. Peers are native GUI components that which are manipulated by the AWT classes. The way peers work and their influence on program development is sometimes confusing, so we'll take a closer look at them here and in subsequent chapters in this book.

The AWT components delegate a great deal of functionality to their peers. For example, when you use the AWT to create an instance of the Menu class, the Java runtime system creates an instance of a menu peer. ...

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.