Java provides a rich set of menu-related classes for creating and interacting with pull-down menus. The MenuComponent class is the superclass of all menu-related classes. It is important to note that it extends the Object class instead of Component, and it defines an AWT class hierarchy separate from the hierarchy descending from Component. It provides several methods, the most useful of which are the following:
getFont() and setFont()— Get and set the font associated with the menu component.
getName() and setName()— Get and set the name of the menu component.
getParent()— Returns the parent container of the menu component.
The MenuComponent class has two direct subclasses, MenuBar and MenuItem, which provide most of the methods for creating ...