25.4 Using Menus with Frames
Menus
are an integral part of GUIs. They allow the user to perform actions without unnecessarily cluttering a GUI with extra components. In Swing GUIs, menus can be attached only to objects of the classes that provide method setJMenuBar
. Two such classes are JFrame
and JApplet
. The classes used to declare menus are JMenuBar
, JMenu
, JMenuItem
, JCheckBoxMenuItem
and class JRadioButtonMenuItem
.
Look-and-Feel Observation 25.1
Menus simplify GUIs because components can be hidden within them. These components will be visible only when the user looks for them by selecting the menu.
Overview of Several Menu-Related ...
Get Java How to Program (early objects), 9/e 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.