MenuBar
Swing component:
JMenuBar
Swing tutorial:
How to Use Menus
Properties
Colors
UI Key | Style Key since v2 | Description |
---|---|---|
MenuBar.foreground | foreground | text color if enabled (used for all JMenu components in menu bar) |
MenuBar.background | background | background color (not used if menu bar is embedded into window title bar on Windows 10/11) |
MenuBar.hoverBackground | hoverBackground | background color of menu item if mouse is over top-level menu item (used
for all JMenu components in menu bar) |
MenuBar.selectionForeground since v2.5 | selectionForeground | text color of menu item if selected (used for all JMenu components in
menu bar) |
MenuBar.selectionBackground since v2.5 | selectionBackground | background color of menu item if selected (used for all JMenu
components in menu bar) |
MenuBar.underlineSelectionColor | underlineSelectionColor | underline selection mark color of menu item for selection type
underline (used for all JMenu components in menu bar) |
MenuBar.underlineSelectionBackground | underlineSelectionBackground | background color of menu item if selected and selection type is
underline (used for all JMenu components in menu bar) |
MenuBar.borderColor | borderColor | color of bottom border |
Sizes
UI Key | Style Key since v2 | Type | Description |
---|---|---|---|
MenuBar.itemMargins | itemMargins | Insets | for top-level menu items the margin space between the menu item bounds and icon/text |
MenuBar.selectionInsets since v3 | selectionInsets | Insets | space between menu item bounds and selection (used for all JMenu
components in menu bar) |
MenuBar.selectionEmbeddedInsets since v3 | selectionEmbeddedInsets | Insets | space between menu item bounds and selection (used for all JMenu
components in menu bar if menu bar is embedded into window title bar) |
MenuBar.selectionArc since v3 | selectionArc | int | arc diameter of the selection corners (used for all JMenu components
in menu bar) |
MenuBar.underlineSelectionHeight | underlineSelectionHeight | int | height of underline selection mark for selection type underline (used
for all JMenu components in menu bar) |
Other
UI Key | Style Key since v2 | Type | Description |
---|---|---|---|
MenuBar.font | font | Font | unused |
MenuBar.border | border | Border | usually a FlatMenuBarBorder |