Summary

Menubars and menus are easy to create and display in the AWT; however, there is a certain amount of drudgery that every application with a menubar must implement. We have encapsulated that drudgery in a FrameWithMenuBar class that is extended by most of the example applications in this chapter. We have also presented a general-utility class, MenuBarPrinter, that prints each menu and menu item contained in a menubar.

Tear-off menus are supported by the AWT. A menu is designated as a tear-off menu at construction time by passing an additional boolean argument being passed to a Menu constructor; a true value indicates that the menu is to be a tear-off; a false value indicates that the menu is not a tear-off. Tear-off menus are not supported ...

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.