W3cubDocs

/OpenJDK 21

Class MetalMenuBarUI

public class MetalMenuBarUI extends BasicMenuBarUI
Metal implementation of MenuBarUI. This class is responsible for providing the metal look and feel for JMenuBars.
Since:
1.5
See Also:

Field Summary

Fields declared in class javax.swing.plaf.basic.BasicMenuBarUI

changeListener, containerListener, menuBar

Constructor Summary

Constructor Description
MetalMenuBarUI()
Constructs a MetalMenuBarUI.

Method Summary

Modifier and Type Method Description
static ComponentUI createUI(JComponent x)
Creates the ComponentUI 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 during installUI.
void update(Graphics g, JComponent c)
If necessary paints the background of the component, then invokes paint.

Methods declared in class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

MetalMenuBarUI

public MetalMenuBarUI()
Constructs a MetalMenuBarUI.

Method Details

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 - if x is null

installUI

public void installUI(JComponent c)
Configures the specified component appropriate for the metal look and feel.
Overrides:
installUI in class ComponentUI
Parameters:
c - the component where this UI delegate is being installed
Throws:
NullPointerException - if c is null.
See Also:

uninstallUI

public void uninstallUI(JComponent c)
Reverses configuration which was done on the specified component during installUI.
Overrides:
uninstallUI in class ComponentUI
Parameters:
c - the component where this UI delegate is being installed
Throws:
NullPointerException - if c is null.
See Also:

update

public void update(Graphics g, JComponent c)
If necessary paints the background of the component, then invokes paint.
Overrides:
update in class ComponentUI
Parameters:
g - Graphics to paint to
c - JComponent painting on
Throws:
NullPointerException - if g or c is null
Since:
1.5
See Also:

© 1993, 2023, 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/en/java/javase/21/docs/api/java.desktop/javax/swing/plaf/metal/MetalMenuBarUI.html