MenuBarSkin (JavaFX 25)
Description: declaration: module: javafx.controls, package: javafx.scene.control.skin, class: MenuBarSkin

# Class MenuBarSkin

java.lang.Object
javafx.scene.control.SkinBase<MenuBar>
javafx.scene.control.skin.MenuBarSkin

All Implemented Interfaces:
  `Skin<MenuBar>`

public class MenuBarSkin extends SkinBase<MenuBar>
Default skin implementation for the `MenuBar` control. In essence it is a simple toolbar. For the time being there is no overflow behavior and we just hide nodes which fall outside the bounds.

Since:
  9
See Also:
  - `MenuBar`

- ## Property Summary

  Properties
  Type
  Property
  Description
  `final ObjectProperty<Pos>`
  `containerAlignment`
  Specifies the alignment of the menu buttons inside the MenuBar (by default it is Pos.TOP_LEFT).
  `final DoubleProperty`
  `spacing`
  Specifies the spacing between menu buttons on the MenuBar.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MenuBarSkin(MenuBar control)`
  Creates a new MenuBarSkin instance, installing the necessary child nodes into the Control `children` list, as well as the necessary input mappings for handling key, mouse, etc events.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final ObjectProperty<Pos>`
  `containerAlignmentProperty()`
  Specifies the alignment of the menu buttons inside the MenuBar (by default it is Pos.TOP_LEFT).
  `static List<CssMetaData<? extends Styleable, ?>>`
  `getClassCssMetaData()`
  Returns the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.
  `final Pos`
  `getContainerAlignment()`
  Gets the value of the `containerAlignment` property.
  `final double`
  `getSpacing()`
  Gets the value of the `spacing` property.
  `final void`
  `setContainerAlignment(Pos value)`
  Sets the value of the `containerAlignment` property.
  `static void`
  `setDefaultSystemMenuBar(MenuBar menuBar)`
  Set the default system menu bar.
  `final void`
  `setSpacing(double value)`
  Sets the value of the `spacing` property.
  `final DoubleProperty`
  `spacingProperty()`
  Specifies the spacing between menu buttons on the MenuBar.

  ### Methods declared in class SkinBase

  `computeBaselineOffset, computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, consumeMouseEvents, dispose, executeAccessibleAction, getChildren, getCssMetaData, getNode, getSkinnable, layoutChildren, layoutInArea, layoutInArea, layoutInArea, positionInArea, positionInArea, pseudoClassStateChanged, queryAccessibleAttribute, registerChangeListener, registerInvalidationListener, registerListChangeListener, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, unregisterChangeListeners, unregisterInvalidationListeners, unregisterListChangeListeners`

  ### Methods declared in class Object

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

  ### Methods declared in interface Skin

  `install`

- ## Property Details

  - ### spacing

    public final DoubleProperty spacingProperty
    Specifies the spacing between menu buttons on the MenuBar.
    See Also:
      - `getSpacing()`
      - `setSpacing(double)`
      - `spacingProperty()`

  - ### containerAlignment

    public final ObjectProperty<Pos> containerAlignmentProperty
    Specifies the alignment of the menu buttons inside the MenuBar (by default it is Pos.TOP_LEFT).
    See Also:
      - `getContainerAlignment()`
      - `setContainerAlignment(Pos)`
      - `containerAlignmentProperty()`

- ## Constructor Details

  - ### MenuBarSkin

    public MenuBarSkin(MenuBar control)
    Creates a new MenuBarSkin instance, installing the necessary child nodes into the Control `children` list, as well as the necessary input mappings for handling key, mouse, etc events.
    Parameters:
      `control` - The control that this skin should be installed onto.

- ## Method Details

  - ### setDefaultSystemMenuBar

    public static void setDefaultSystemMenuBar(MenuBar menuBar)
    Set the default system menu bar. This allows an application to keep menu in the system menu bar after the last Window is closed.
    Parameters:
      `menuBar` - the menu bar

  - ### setSpacing

    public final void setSpacing(double value)
    Sets the value of the `spacing` property.
    Property description:
      Specifies the spacing between menu buttons on the MenuBar.
    Parameters:
      `value` - the value for the `spacing` property
    See Also:
      - `getSpacing()`
      - `spacingProperty()`

  - ### getSpacing

    public final double getSpacing()
    Gets the value of the `spacing` property.
    Property description:
      Specifies the spacing between menu buttons on the MenuBar.
    Returns:
      the value of the `spacing` property
    See Also:
      - `setSpacing(double)`
      - `spacingProperty()`

  - ### spacingProperty

    public final DoubleProperty spacingProperty()
    Specifies the spacing between menu buttons on the MenuBar.
    Returns:
      the `spacing` property
    See Also:
      - `getSpacing()`
      - `setSpacing(double)`

  - ### setContainerAlignment

    public final void setContainerAlignment(Pos value)
    Sets the value of the `containerAlignment` property.
    Property description:
      Specifies the alignment of the menu buttons inside the MenuBar (by default it is Pos.TOP_LEFT).
    Parameters:
      `value` - the value for the `containerAlignment` property
    See Also:
      - `getContainerAlignment()`
      - `containerAlignmentProperty()`

  - ### getContainerAlignment

    public final Pos getContainerAlignment()
    Gets the value of the `containerAlignment` property.
    Property description:
      Specifies the alignment of the menu buttons inside the MenuBar (by default it is Pos.TOP_LEFT).
    Returns:
      the value of the `containerAlignment` property
    See Also:
      - `setContainerAlignment(Pos)`
      - `containerAlignmentProperty()`

  - ### containerAlignmentProperty

    public final ObjectProperty<Pos> containerAlignmentProperty()
    Specifies the alignment of the menu buttons inside the MenuBar (by default it is Pos.TOP_LEFT).
    Returns:
      the `containerAlignment` property
    See Also:
      - `getContainerAlignment()`
      - `setContainerAlignment(Pos)`

  - ### getClassCssMetaData

    public static List<CssMetaData<? extends Styleable, ?>> getClassCssMetaData()
    Returns the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.
    Returns:
      the CssMetaData associated with this class, which may include the CssMetaData of its superclasses