Incredible as it may seem, popup menus were nowhere to be found in the original AWT. As a result, many developers implemented their own popups, but since such popups were drawn entirely in Java code and not implemented by a peer, the native look-and-feel was lost. Fortunately, this deficiency was remedied in the 1.1 version of the AWT with the introduction of a peer-based popup menu.
Popup menus are extremely easy to use. In this section, we'll discuss creating popups, displaying them, and handling the events they generate.
Popup menus must be attached to an AWT component. In fact, java.awt.Component has two methods for attaching and removing popup menus: