Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

SWING menu class


May 15, 2021 SWING


Table of contents


SWING menu class

As we know, each top window has a menu bar associated with it. T his menu bar includes a variety of menu options available to end users. A nd each selection contains a list of options called drop-down menus. The controls for menus and menu items are sub-classes of the MenuComponent class.

The menu hierarchy

SWING menu class

Menu controls

Sr. No. Control and description
1 JMenuBar
The JMenuBar object is associated with the top window
2 JMenuItem
Items in the menu must belong to JMenuItem or any of its sub-classes.
3 JMenu
The JMenu object is a drop-down menu component that appears from the menu bar.
4 JCheckBoxMenuItem
JCheckBoxMenuItem is a sub-class of JMenuItem.
5 JRadioButtonMenuItem
JRadio Button MenuItem is a sub-class of JMenuItem.
6 JPopupMenu
JPopupMenu can pop up dynamically in a specified location within a component.