O'Reilly logo

Sun Certification Training Guide (310-025, 310-027): Java™ 2 Programmer and Developer Exams by Jamie Jaworski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Menus

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required