What are AWT peers?
Ans : Peers are native-platform on-screen counterparts to AWT components. The AWT provides a cross-platform Application Programming Interface (API) for managing user-interface elements and behaviors. To provide a native look and feel, though, the AWT components rely on user-interface elements from the native-platform toolkits to draw themselves on screen and to provide an initial layer of event processing. These native counterparts are called peers. The java.awt.peer package defines interfaces through which Java components can control and otherwise communicate with their peers. The AWT peer interfaces are implemented by platform-specific peer classes that access the platform’s own toolkit using native methods (that is, methods implemented in a language other than Java). For example, an AWT button has three Javalanguage layers: • Button, a class in the java.awt package • ButtonPeer, an interface in the java.awt.peer package • a platform-specific button peer class containing native metho