java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.MenuBarUI
javax.swing.plaf.basic.BasicMenuBarUI
- Direct Known Subclasses:
MetalMenuBarUI
,SynthMenuBarUI
public class BasicMenuBarUI extends MenuBarUI
A default L&F implementation of MenuBarUI. This implementation
is a "combined" view/controller.
-
Field Summary
Fields Modifier and Type Field Description protected ChangeListener
changeListener
The instance ofChangeListener
.protected ContainerListener
containerListener
The instance ofContainerListener
.protected JMenuBar
menuBar
The instance ofJMenuBar
. -
Constructor Summary
Constructors Constructor Description BasicMenuBarUI()
-
Method Summary
Modifier and Type Method Description protected ChangeListener
createChangeListener()
Returns an instance ofChangeListener
.protected ContainerListener
createContainerListener()
Returns an instance ofContainerListener
.static ComponentUI
createUI(JComponent x)
Returns a new instance ofBasicMenuBarUI
.protected void
installDefaults()
Installs default properties.protected void
installKeyboardActions()
Registers keyboard actions.protected void
installListeners()
Registers listeners.protected void
uninstallDefaults()
Uninstalls default properties.protected void
uninstallKeyboardActions()
Unregisters keyboard actions.protected void
uninstallListeners()
Unregisters listeners.Methods declared in class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, installUI, paint, uninstallUI, update
-
Field Details
-
menuBar
The instance ofJMenuBar
. -
containerListener
The instance ofContainerListener
. -
changeListener
The instance ofChangeListener
.
-
-
Constructor Details
-
BasicMenuBarUI
public BasicMenuBarUI()
-
-
Method Details
-
createUI
Returns a new instance ofBasicMenuBarUI
.- Parameters:
x
- a component- Returns:
- a new instance of
BasicMenuBarUI
-
installDefaults
protected void installDefaults()Installs default properties. -
installListeners
protected void installListeners()Registers listeners. -
installKeyboardActions
protected void installKeyboardActions()Registers keyboard actions. -
uninstallDefaults
protected void uninstallDefaults()Uninstalls default properties. -
uninstallListeners
protected void uninstallListeners()Unregisters listeners. -
uninstallKeyboardActions
protected void uninstallKeyboardActions()Unregisters keyboard actions. -
createContainerListener
Returns an instance ofContainerListener
.- Returns:
- an instance of
ContainerListener
-
createChangeListener
Returns an instance ofChangeListener
.- Returns:
- an instance of
ChangeListener
-