Think of a menu as a way to arrange buttons. There are several types.
A menu bar can be added to the top of any top-level containers, eg, JFrame, JApplet, or JDialog. Note that a menu bar can not be added to JPanel.
Dropdown menus have three parts:
It is easy to see how menu items are buttons that appear when a menu appears. But the menu names in the menu bar are also buttons. When you press on these "buttons", they create a popup menu that you see as a dropdown menu.
The following program creates a simple menu. It doesn't do anything useful.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// File : menus/MenuDemo.java // Purpo