- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.MenuBarUI
-
- javax.swing.plaf.basic.BasicMenuBarUI
-
- javax.swing.plaf.metal.MetalMenuBarUI
-
public class MetalMenuBarUI extends BasicMenuBarUI
Metal implementation ofMenuBarUI
. This class is responsible for providing the metal look and feel forJMenuBar
s.- Since:
- 1.5
- See Also:
MenuBarUI
-
-
Field Summary
-
Fields inherited from class javax.swing.plaf.basic.BasicMenuBarUI
changeListener, containerListener, menuBar
-
-
Constructor Summary
Constructors Constructor and Description MetalMenuBarUI()
-
Method Summary
Methods Modifier and Type Method and Description static ComponentUI
createUI(JComponent x)
Creates theComponentUI
implementation for the passed in component.void
installUI(JComponent c)
Configures the specified component appropriate for the metal look and feel.void
uninstallUI(JComponent c)
Reverses configuration which was done on the specified component duringinstallUI
.void
update(Graphics g, JComponent c)
If necessary paints the background of the component, then invokespaint
.-
Methods inherited from class javax.swing.plaf.basic.BasicMenuBarUI
createChangeListener, createContainerListener, getMaximumSize, getMinimumSize, installDefaults, installKeyboardActions, installListeners, uninstallDefaults, uninstallKeyboardActions, uninstallListeners
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getPreferredSize, paint
-
-
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent x)
Creates theComponentUI
implementation for the passed in component.- Parameters:
x
- JComponent to create the ComponentUI implementation for- Returns:
- ComponentUI implementation for
x
- Throws:
NullPointerException
- ifx
is null
-
installUI
public void installUI(JComponent c)
Configures the specified component appropriate for the metal look and feel.- Overrides:
installUI
in classBasicMenuBarUI
- Parameters:
c
- the component where this UI delegate is being installed- Throws:
NullPointerException
- ifc
is null.- See Also:
ComponentUI.uninstallUI(javax.swing.JComponent)
,JComponent.setUI(javax.swing.plaf.ComponentUI)
,JComponent.updateUI()
-
uninstallUI
public void uninstallUI(JComponent c)
Reverses configuration which was done on the specified component duringinstallUI
.- Overrides:
uninstallUI
in classBasicMenuBarUI
- Parameters:
c
- the component where this UI delegate is being installed- Throws:
NullPointerException
- ifc
is null.- See Also:
ComponentUI.installUI(javax.swing.JComponent)
,JComponent.updateUI()
-
update
public void update(Graphics g, JComponent c)
If necessary paints the background of the component, then invokespaint
.- Overrides:
update
in classComponentUI
- Parameters:
g
- Graphics to paint toc
- JComponent painting on- Throws:
NullPointerException
- ifg
orc
is null- Since:
- 1.5
- See Also:
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)
,ComponentUI.paint(java.awt.Graphics, javax.swing.JComponent)
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-javax/swing/plaf/metal/metalmenubarui.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.