Class MetalMenuBarUI
- 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 of MenuBarUI
. This class is responsible for providing the metal look and feel for JMenuBar
s.
- Since:
- 1.5
- See Also:
MenuBarUI
Fields
Fields inherited from class javax.swing.plaf.basic.BasicMenuBarUI
changeListener, containerListener, menuBar
Constructors
Constructor and Description |
---|
MetalMenuBarUI() |
Methods
Modifier and Type | Method and Description |
---|---|
static ComponentUI |
createUI(JComponent x) Creates the |
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 during |
void |
update(Graphics g,
JComponent c) If necessary paints the background of the component, then invokes |
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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructors
MetalMenuBarUI
public MetalMenuBarUI()
Methods
createUI
public static ComponentUI createUI(JComponent x)
Creates the ComponentUI
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 during installUI
.
- 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 invokes paint
.
- Overrides:
-
update
in classComponentUI
- Parameters:
-
g
- Graphics to paint to -
c
- 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)
© 1993, 2020, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/javase/8/docs/api/javax/swing/plaf/metal/MetalMenuBarUI.html