APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javafx.scene.layout

public Class HeaderBar

extends Region
Class Inheritance
Imports
com.sun.javafx.geom.Vec2d, com.sun.javafx.scene.layout.HeaderButtonBehavior, com.sun.javafx.stage.StageHelper, javafx.application.ColorScheme, javafx.beans.property.BooleanProperty, .BooleanPropertyBase, .DoubleProperty, .ObjectProperty, .ObjectPropertyBase, .Property, .ReadOnlyDoubleProperty, .ReadOnlyObjectProperty, .SimpleObjectProperty, javafx.css.StyleableDoubleProperty, javafx.event.Event, javafx.geometry.Dimension2D, .HPos, .Insets, .Orientation, .Pos, .VPos, javafx.scene.Node, .Scene, javafx.scene.input.ContextMenuEvent, .MouseEvent, javafx.stage.Stage, .StageStyle, javafx.util.Subscription

A client-area header bar that is used as a replacement for the system-provided header bar in stages with the StageStyle#EXTENDED style. This class enables the click-and-drag to move and double-click to maximize behaviors that are usually afforded by system-provided header bars. The entire HeaderBar background is draggable by default, but its content is not. Applications can specify draggable content nodes of the HeaderBar with the dragType attached property.

HeaderBar is a layout container that allows applications to place scene graph nodes in three areas: left, center, and right. All areas can be null. The default minHeight of the HeaderBar is set to match systemMinHeight (unless explicitly set by a stylesheet or application code), which usually corresponds to the height of the system-provided header buttons.

Single header bar

Most applications should only add a single HeaderBar to the scene graph, placed at the top of the scene and extending its entire width. This ensures that the reported values for leftSystemInset and rightSystemInset, which describe the areas reserved for the system-provided header buttons, correctly align with the location of the HeaderBar and are taken into account when the contents of the HeaderBar are laid out.

Multiple header bars

Applications that use multiple header bars might need to configure the additional padding inserted into the layout to account for the system-reserved areas. For example, when two header bars are placed next to each other in the horizontal direction, the default configuration adds unnecessary additional padding between the two header bars. In this case, the leftSystemPadding and rightSystemPadding properties can be used to remove the padding that is not needed.

Header button height

Applications can specify the preferred height for the system-provided header buttons by setting the systemButtonHeight attached property for the Stage associated with the header bar. This can be used to achieve a more cohesive visual appearance by having the system-provided header buttons match the height of the client-area header bar.

Color scheme

The color scheme of the system-provided default header buttons is automatically adjusted to match the scene color scheme. Applications can specify a different color scheme for the system-provided header buttons with the systemColorScheme attached property.

Custom header buttons

If more control over the header buttons is desired, applications can opt out of the system-provided header buttons by setting the systemButtonHeight attached property for the Stage associated with the header bar to zero and place custom header buttons in the JavaFX scene graph instead. Any JavaFX control can be used as a custom header button by specifying its semantic type with the buttonType attached property.

System menu

Some platforms support a system menu that can be summoned by right-clicking the draggable area. The system menu will not be shown when:
  1. the Stage is in full-screen mode, or
  2. the HeaderBar has consumed the ContextMenuEvent#CONTEXT_MENU_REQUESTED event.

Layout constraints

The left and right children will be resized to their preferred widths and extend the height of the HeaderBar. The center child will be resized to fill the available space. HeaderBar honors the minimum, preferred, and maximum sizes of its children. If a child's resizable range prevents it from being resized to fit within its position, it will be vertically centered relative to the available space; this alignment can be customized with a layout constraint.

An application may set constraints on individual children to customize their layout. For each constraint, HeaderBar provides static getter and setter methods.

Layout constraints of HeaderBar
ConstraintTypeDescription
alignmentPos The alignment of the child within its area of the HeaderBar.
margin InsetsMargin space around the outside of the child.

Special layout of centered child

If a child is configured to be centered in the center area (i.e. its alignment constraint is either null, Pos#CENTER, Pos#TOP_CENTER, or Pos#BOTTOM_CENTER), it will be centered with respect to the entire header bar, and not with respect to the center area only. This means that, for a header bar that extends the entire width of the Stage, the child will appear to be horizontally centered within the Stage.

If a child should instead be centered with respect to the center area only, a possible solution is to place another layout container (such as BorderPane) in the center area, and then center the child within the other layout container.

Example

Usually, HeaderBar is placed in a root container like BorderPane to align it with the top of the scene:
public class MyApp extends Application {
    @Override
    public void start(Stage stage) {
        var button = new Button("My button");
        HeaderBar.setAlignment(button, Pos.CENTER_LEFT);
        HeaderBar.setMargin(button, new Insets(5));

        var headerBar = new HeaderBar();
        headerBar.setCenter(button);

        var root = new BorderPane();
        root.setTop(headerBar);

        stage.setScene(new Scene(root));
        stage.initStyle(StageStyle.EXTENDED);
        stage.show();
    }
}
Since
27

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private static final String
private ObjectProperty<Node>
center

The center area of the HeaderBar.

private ObjectProperty<Node>
left

Hides javafx.scene.Parent.left.

The left area of the HeaderBar.
private BooleanProperty
leftSystemPadding

Specifies whether additional padding should be added to the left side of the HeaderBar.

private static final String
private ObjectProperty<Node>
right

Hides javafx.scene.Parent.right.

The right area of the HeaderBar.
private BooleanProperty
rightSystemPadding

Specifies whether additional padding should be added to the right side of the HeaderBar.

private Subscription
public static final double
USE_DEFAULT_SIZE

Sentinel value that can be used for the systemButtonHeight attached property to indicate that the platform should choose the platform-specific default button height.

Inherited from javafx.scene.layout.Region:
TEMP_VEC2DUSE_COMPUTED_SIZEUSE_PREF_SIZE

Constructor Summary

AccessConstructor and Description
public
HeaderBar()

Creates a new HeaderBar.

public
HeaderBar(Node
the left node, or null
left
,
Node
the center node, or null
center
,
Node
the right node, or null
right
)

Creates a new HeaderBar with the specified children.

Method Summary

Modifier and TypeMethod and Description
public static ObjectProperty<HeaderButtonType>

Returns:

the buttonType property
buttonTypeProperty
(Node
the child node
child
)

Specifies the HeaderButtonType of the child, indicating its semantic use in the header bar.

public final ObjectProperty<Node>
private boolean
childHasContentBias(Node child, Orientation orientation)

protected double
computeMinHeight(double width)

Overrides javafx.scene.layout.Region.computeMinHeight.

Computes the minimum height of this region.

protected double
computeMinWidth(double height)

Overrides javafx.scene.layout.Region.computeMinWidth.

Computes the minimum width of this region.

protected double
computePrefHeight(double width)

Overrides javafx.scene.layout.Region.computePrefHeight.

Computes the preferred height of this region for the given width; Region subclasses should override this method to return an appropriate value based on their content and layout strategy.

public static ObjectProperty<HeaderDragType>

Returns:

the dragType property
dragTypeProperty
(Node
the child node
child
)

Specifies the HeaderDragType of the child, indicating whether it is a draggable part of the HeaderBar.

public static Pos

Returns:

the alignment position for the child, or null if no alignment was set
getAlignment
(Node
the child node
child
)

Returns the child's alignment in the HeaderBar.

private double
getAreaHeight(Node child, double width, boolean minimum)

private double
getAreaWidth(Node child, double height, boolean minimum)

public static HeaderButtonType

Returns:

the HeaderButtonType, or null
getButtonType
(Node
the child node
child
)

Gets the value of the buttonType attached property for the specified child.

public final Node
public static HeaderDragType

Returns:

the HeaderDragType, or null if not set
getDragType
(Node
the child node
child
)

Gets the value of the dragType attached property for the specified child.

public final Node
public static Dimension2D

Returns:

the size of the left system-reserved inset
getLeftSystemInset
(Stage
the Stage
stage
)

Gets the value of the leftSystemInset attached property for the specified Stage.

public static Insets

Returns:

the margin for the child, or null if no margin was set
getMargin
(Node
the child node
child
)

Returns the child's margin.

private Insets
public final Node
public static Dimension2D

Returns:

the size of the right system-reserved inset
getRightSystemInset
(Stage
the Stage
stage
)

Gets the value of the rightSystemInset attached property for the specified Stage.

public static double

Returns:

the preferred height of the system-provided header buttons
getSystemButtonHeight
(Stage
the Stage
stage
)

Gets the value of the systemButtonHeight attached property for the specified Stage.

public static ColorScheme

Returns:

the color scheme
getSystemColorScheme
(Stage
the Stage
stage
)

Gets the value of the systemColorScheme attached property for the specified Stage.

public static double

Returns:

the system-recommended minimum height for the HeaderBar
getSystemMinHeight
(Stage
the Stage
stage
)

Gets the value of the systemMinHeight attached property for the specified Stage.

public final boolean
public final boolean
protected void
layoutChildren()

Overrides javafx.scene.Parent.layoutChildren.

Invoked during the layout pass to layout the children in this Parent.

public final ObjectProperty<Node>
public static ReadOnlyObjectProperty<Dimension2D>

Returns:

the leftSystemInset attached property
leftSystemInsetProperty
(Stage
the Stage
stage
)

Describes the size of the left system-reserved inset for the specified Stage, which is an area reserved for the iconify, maximize, and close window buttons.

public final BooleanProperty
private void
private double
resizeChild(Node child, double adjustedWidth, boolean fillWidth, double insideHeight, Insets margin)

public final ObjectProperty<Node>
public static ReadOnlyObjectProperty<Dimension2D>

Returns:

the rightSystemInset attached property
rightSystemInsetProperty
(Stage
the Stage
stage
)

Describes the size of the right system-reserved inset for the specified Stage, which is an area reserved for the iconify, maximize, and close window buttons.

public final BooleanProperty
public static void
setAlignment(Node
the child node
child
,
Pos
the alignment position
value
)

Sets the alignment for the child when contained in a HeaderBar.

public static void
setButtonType(Node
the child node
child
,
HeaderButtonType
the HeaderButtonType, or null
value
)

Sets the value of the buttonType attached property for the specified child.

public final void
setCenter(Node value)

public static void
setDragType(Node
the child node
child
,
HeaderDragType
the HeaderDragType, or null to remove the flag
value
)

Sets the value of the dragType attached property for the specified child.

public final void
setLeft(Node value)

public final void
setLeftSystemPadding(boolean value)

public static void
setMargin(Node
the child node
child
,
Insets
the margin of space around the child
value
)

Sets the margin for the child when contained in a HeaderBar.

public final void
setRight(Node value)

public final void
setRightSystemPadding(boolean value)

public static void
setSystemButtonHeight(Stage
the Stage
stage
,
double
the preferred height, or 0 to hide the system-provided header buttons
height
)

Sets the value of the systemButtonHeight attached property for the specified Stage.

public static void
setSystemColorScheme(Stage
the Stage
stage
,
ColorScheme
the color scheme, or null to indicate no preference
value
)

Sets the value of the systemColorScheme attached property for the specified Stage.

public static DoubleProperty

Returns:

the systemButtonHeight attached property
systemButtonHeightProperty
(Stage
the Stage
stage
)

Specifies the preferred height of the system-provided header buttons for the specified Stage.

public static ObjectProperty<ColorScheme>

Returns:

the systemColorScheme attached property
systemColorSchemeProperty
(Stage
the Stage
stage
)

Specifies the color scheme of the system-provided header buttons for the specified Stage.

public static ReadOnlyDoubleProperty

Returns:

the systemMinHeight attached property
systemMinHeightProperty
(Stage
the Stage
stage
)

Specifies the system-recommended minimum height for the HeaderBar for the specified Stage, which usually corresponds to the height of the default header buttons.

Inherited from javafx.scene.layout.Region:
addImageListeneradjustHeightByMarginadjustWidthByMarginbackgroundPropertyborderPropertyboundedNodeSizeWithBiasboundedSizecacheShapePropertycenterShapePropertycomputeChildMaxAreaHeightcomputeChildMaxAreaWidthcomputeChildMinAreaHeightcomputeChildMinAreaHeightcomputeChildMinAreaWidthcomputeChildMinAreaWidthcomputeChildPrefAreaHeightcomputeChildPrefAreaHeightcomputeChildPrefAreaWidthcomputeChildPrefAreaWidthcomputeMaxHeightcomputeMaxMinAreaHeightcomputeMaxMinAreaHeightcomputeMaxMinAreaHeightcomputeMaxMinAreaWidthcomputeMaxMinAreaWidthcomputeMaxMinAreaWidthcomputeMaxPrefAreaHeightcomputeMaxPrefAreaHeightcomputeMaxPrefAreaHeightcomputeMaxPrefAreaWidthcomputeMaxPrefAreaWidthcomputeMaxPrefAreaWidthcomputeMaxWidthcomputePrefWidthcomputeXOffsetcomputeYOffsetcreateDoubleArraygetAreaBaselineOffsetgetAreaBaselineOffsetgetAreaBaselineOffsetgetAreaBaselineOffsetgetAreaBaselineOffsetgetAreaBaselineOffsetgetBackgroundgetBordergetClassCssMetaDatagetCssMetaDatagetHeightgetInsetsgetMaxBaselineComplementgetMaxHeightgetMaxWidthgetMinBaselineComplementgetMinHeightgetMinWidthgetOpaqueInsetsgetPaddinggetPrefBaselineComplementgetPrefHeightgetPrefWidthgetShapegetSnapScaleXgetSnapScaleYgetUserAgentStylesheetgetWidthheightPropertyinsetsPropertyisCacheShapeisCenterShapeisResizableisScaleShapeisSnapToPixellayoutInArealayoutInArealayoutInArealayoutInAreamaxHeightmaxHeightPropertymaxWidthmaxWidthPropertyminHeightminHeightPropertyminWidthminWidthPropertyopaqueInsetsPropertypaddingPropertypositionInAreapositionInAreaprefHeightprefHeightPropertyprefWidthprefWidthPropertyremoveImageListenerresizescaleShapePropertysetBackgroundsetBordersetCacheShapesetCenterShapesetHeightsetMaxHeightsetMaxSizesetMaxWidthsetMinHeightsetMinSizesetMinWidthsetOpaqueInsetssetPaddingsetPrefHeightsetPrefSizesetPrefWidthsetScaleShapesetShapesetSnapToPixelsetWidthshapePropertysnappedBottomInsetsnappedLeftInsetsnappedRightInsetsnappedTopInsetsnapPortionXsnapPortionYsnapPositionsnapPositionXsnapPositionYsnapSizesnapSizeXsnapSizeYsnapSpacesnapSpaceXsnapSpaceYsnapToPixelPropertywidthProperty

Field Detail

ALIGNMENTback to summary
private static final String ALIGNMENT
centerback to summary
private ObjectProperty<Node> center

The center area of the HeaderBar.

Default Value
null
leftback to summary
private ObjectProperty<Node> left

Hides javafx.scene.Parent.left.

The left area of the HeaderBar.

Default Value
null
leftSystemPaddingback to summary
private BooleanProperty leftSystemPadding

Specifies whether additional padding should be added to the left side of the HeaderBar. The size of the additional padding corresponds to the size of the system-reserved area that contains the default header buttons (iconify, maximize, and close). If the system-reserved area contains no header buttons, no additional padding is added to the left side of the HeaderBar.

Applications that use a single HeaderBar extending the entire width of the window should set this property to true to prevent the header buttons from overlapping the content of the HeaderBar.

Default Value
true
See Also
rightSystemPadding
MARGINback to summary
private static final String MARGIN
rightSystemPaddingback to summary
private BooleanProperty rightSystemPadding

Specifies whether additional padding should be added to the right side of the HeaderBar. The size of the additional padding corresponds to the size of the system-reserved area that contains the default header buttons (iconify, maximize, and close). If the system-reserved area contains no header buttons, no additional padding is added to the right side of the HeaderBar.

Applications that use a single HeaderBar extending the entire width of the window should set this property to true to prevent the header buttons from overlapping the content of the HeaderBar.

Default Value
true
See Also
leftSystemPadding
subscriptionsback to summary
private Subscription subscriptions
USE_DEFAULT_SIZEback to summary
public static final double USE_DEFAULT_SIZE

Sentinel value that can be used for the systemButtonHeight attached property to indicate that the platform should choose the platform-specific default button height.

Constructor Detail

HeaderBarback to summary
public HeaderBar()

Creates a new HeaderBar.

HeaderBarback to summary
public HeaderBar(Node left, Node center, Node right)

Creates a new HeaderBar with the specified children.

Parameters
left:Node

the left node, or null

center:Node

the center node, or null

right:Node

the right node, or null

Method Detail

buttonTypePropertyback to summary
public static ObjectProperty<HeaderButtonType> buttonTypeProperty(Node child)

Specifies the HeaderButtonType of the child, indicating its semantic use in the header bar.

This property can be set on any Node. Specifying a HeaderButtonType also provides the behavior associated with the button type. If the default behavior is not desired, applications can register an event filter on the child node that consumes the MouseEvent#MOUSE_RELEASED event.

Parameters
child:Node

the child node

Returns:ObjectProperty<HeaderButtonType>

the buttonType property

Annotations
@SuppressWarnings:unchecked
Default Value
null
centerPropertyback to summary
public final ObjectProperty<Node> centerProperty()
childHasContentBiasback to summary
private boolean childHasContentBias(Node child, Orientation orientation)
computeMinHeightback to summary
protected double computeMinHeight(double width)

Overrides javafx.scene.layout.Region.computeMinHeight.

Doc from javafx.scene.layout.Region.computeMinHeight.

Computes the minimum height of this region. Returns the sum of the top and bottom insets by default. Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.

Annotations
@Override
computeMinWidthback to summary
protected double computeMinWidth(double height)

Overrides javafx.scene.layout.Region.computeMinWidth.

Doc from javafx.scene.layout.Region.computeMinWidth.

Computes the minimum width of this region. Returns the sum of the left and right insets by default. region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a VERTICAL content bias, then the height parameter can be ignored.

Annotations
@Override
computePrefHeightback to summary
protected double computePrefHeight(double width)

Overrides javafx.scene.layout.Region.computePrefHeight.

Doc from javafx.scene.layout.Region.computePrefHeight.

Computes the preferred height of this region for the given width; Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.

Annotations
@Override
dragTypePropertyback to summary
public static ObjectProperty<HeaderDragType> dragTypeProperty(Node child)

Specifies the HeaderDragType of the child, indicating whether it is a draggable part of the HeaderBar. A value of null indicates that the drag type is not set.

Parameters
child:Node

the child node

Returns:ObjectProperty<HeaderDragType>

the dragType property

Annotations
@SuppressWarnings:unchecked
Default Value
null
getAlignmentback to summary
public static Pos getAlignment(Node child)

Returns the child's alignment in the HeaderBar.

Parameters
child:Node

the child node

Returns:Pos

the alignment position for the child, or null if no alignment was set

getAreaHeightback to summary
private double getAreaHeight(Node child, double width, boolean minimum)
getAreaWidthback to summary
private double getAreaWidth(Node child, double height, boolean minimum)
getButtonTypeback to summary
public static HeaderButtonType getButtonType(Node child)

Gets the value of the buttonType attached property for the specified child.

Parameters
child:Node

the child node

Returns:HeaderButtonType

the HeaderButtonType, or null

Annotations
@SuppressWarnings:unchecked
getCenterback to summary
public final Node getCenter()
getDragTypeback to summary
public static HeaderDragType getDragType(Node child)

Gets the value of the dragType attached property for the specified child.

Parameters
child:Node

the child node

Returns:HeaderDragType

the HeaderDragType, or null if not set

Annotations
@SuppressWarnings:unchecked
getLeftback to summary
public final Node getLeft()
getLeftSystemInsetback to summary
public static Dimension2D getLeftSystemInset(Stage stage)

Gets the value of the leftSystemInset attached property for the specified Stage.

Parameters
stage:Stage

the Stage

Returns:Dimension2D

the size of the left system-reserved inset

getMarginback to summary
public static Insets getMargin(Node child)

Returns the child's margin.

Parameters
child:Node

the child node

Returns:Insets

the margin for the child, or null if no margin was set

getNodeMarginback to summary
private Insets getNodeMargin(Node child)
getRightback to summary
public final Node getRight()
getRightSystemInsetback to summary
public static Dimension2D getRightSystemInset(Stage stage)

Gets the value of the rightSystemInset attached property for the specified Stage.

Parameters
stage:Stage

the Stage

Returns:Dimension2D

the size of the right system-reserved inset

getSystemButtonHeightback to summary
public static double getSystemButtonHeight(Stage stage)

Gets the value of the systemButtonHeight attached property for the specified Stage.

Parameters
stage:Stage

the Stage

Returns:double

the preferred height of the system-provided header buttons

getSystemColorSchemeback to summary
public static ColorScheme getSystemColorScheme(Stage stage)

Gets the value of the systemColorScheme attached property for the specified Stage.

Parameters
stage:Stage

the Stage

Returns:ColorScheme

the color scheme

getSystemMinHeightback to summary
public static double getSystemMinHeight(Stage stage)

Gets the value of the systemMinHeight attached property for the specified Stage.

Parameters
stage:Stage

the Stage

Returns:double

the system-recommended minimum height for the HeaderBar

isLeftSystemPaddingback to summary
public final boolean isLeftSystemPadding()
isRightSystemPaddingback to summary
public final boolean isRightSystemPadding()
layoutChildrenback to summary
protected void layoutChildren()

Overrides javafx.scene.Parent.layoutChildren.

Doc from javafx.scene.Parent.layoutChildren.

Invoked during the layout pass to layout the children in this Parent. By default it will only set the size of managed, resizable content to their preferred sizes and does not do any node positioning.

Subclasses should override this function to layout content as needed.

Annotations
@Override
leftPropertyback to summary
public final ObjectProperty<Node> leftProperty()
leftSystemInsetPropertyback to summary
public static ReadOnlyObjectProperty<Dimension2D> leftSystemInsetProperty(Stage stage)

Describes the size of the left system-reserved inset for the specified Stage, which is an area reserved for the iconify, maximize, and close window buttons. If there are no window buttons on the left side of the window, the returned area is an empty Dimension2D.

Parameters
stage:Stage

the Stage

Returns:ReadOnlyObjectProperty<Dimension2D>

the leftSystemInset attached property

leftSystemPaddingPropertyback to summary
public final BooleanProperty leftSystemPaddingProperty()
onStageChangedback to summary
private void onStageChanged(Stage stage)
resizeChildback to summary
private double resizeChild(Node child, double adjustedWidth, boolean fillWidth, double insideHeight, Insets margin)
rightPropertyback to summary
public final ObjectProperty<Node> rightProperty()
rightSystemInsetPropertyback to summary
public static ReadOnlyObjectProperty<Dimension2D> rightSystemInsetProperty(Stage stage)

Describes the size of the right system-reserved inset for the specified Stage, which is an area reserved for the iconify, maximize, and close window buttons. If there are no window buttons on the right side of the window, the returned area is an empty Dimension2D.

Parameters
stage:Stage

the Stage

Returns:ReadOnlyObjectProperty<Dimension2D>

the rightSystemInset attached property

rightSystemPaddingPropertyback to summary
public final BooleanProperty rightSystemPaddingProperty()
setAlignmentback to summary
public static void setAlignment(Node child, Pos value)

Sets the alignment for the child when contained in a HeaderBar. If set, it will override the header bar's default alignment for the child's position. Setting the value to null will remove the constraint.

Parameters
child:Node

the child node

value:Pos

the alignment position

setButtonTypeback to summary
public static void setButtonType(Node child, HeaderButtonType value)

Sets the value of the buttonType attached property for the specified child.

Parameters
child:Node

the child node

value:HeaderButtonType

the HeaderButtonType, or null

setCenterback to summary
public final void setCenter(Node value)
setDragTypeback to summary
public static void setDragType(Node child, HeaderDragType value)

Sets the value of the dragType attached property for the specified child.

Parameters
child:Node

the child node

value:HeaderDragType

the HeaderDragType, or null to remove the flag

setLeftback to summary
public final void setLeft(Node value)
setLeftSystemPaddingback to summary
public final void setLeftSystemPadding(boolean value)
setMarginback to summary
public static void setMargin(Node child, Insets value)

Sets the margin for the child when contained in a HeaderBar. If set, the header bar will lay it out with the margin space around it. Setting the value to null will remove the constraint.

Parameters
child:Node

the child node

value:Insets

the margin of space around the child

setRightback to summary
public final void setRight(Node value)
setRightSystemPaddingback to summary
public final void setRightSystemPadding(boolean value)
setSystemButtonHeightback to summary
public static void setSystemButtonHeight(Stage stage, double height)

Sets the value of the systemButtonHeight attached property for the specified Stage.

Parameters
stage:Stage

the Stage

height:double

the preferred height, or 0 to hide the system-provided header buttons

setSystemColorSchemeback to summary
public static void setSystemColorScheme(Stage stage, ColorScheme value)

Sets the value of the systemColorScheme attached property for the specified Stage.

Parameters
stage:Stage

the Stage

value:ColorScheme

the color scheme, or null to indicate no preference

systemButtonHeightPropertyback to summary
public static DoubleProperty systemButtonHeightProperty(Stage stage)

Specifies the preferred height of the system-provided header buttons for the specified Stage.

Any value except zero and USE_DEFAULT_SIZE is only a hint for the platform window toolkit. The platform might accommodate the preferred height in various ways, such as by stretching the header buttons (fully or partially) to fill the preferred height, or centering the header buttons (fully or partially) within the preferred height. Some platforms might only accommodate the preferred height within platform-specific constraints, or ignore it entirely.

Setting the preferred height to zero hides the system-provided header buttons, allowing applications to use custom header buttons instead (see setButtonType(Node, HeaderButtonType)).

The default value USE_DEFAULT_SIZE indicates that the platform should choose the button height.

Parameters
stage:Stage

the Stage

Returns:DoubleProperty

the systemButtonHeight attached property

Default Value
USE_DEFAULT_SIZE
systemColorSchemePropertyback to summary
public static ObjectProperty<ColorScheme> systemColorSchemeProperty(Stage stage)

Specifies the color scheme of the system-provided header buttons for the specified Stage.

This is a null-coalescing property: if set to null (using the setter method, Property#setValue(Object), or with a binding), the property evaluates to the value of Scene.Preferences#colorSchemeProperty(). Likewise, specifying a non-null value will override the scene-provided value. Overriding the scene-provided color scheme is usually only necessary in the rare case when an application needs different color schemes for header buttons and the window content (bright title bar in dark mode, or a dark title bar in light mode).

The specified color scheme is only a hint for the platform window toolkit and may be ignored.

Parameters
stage:Stage

the Stage

Returns:ObjectProperty<ColorScheme>

the systemColorScheme attached property

Default Value
Scene.Preferences#getColorScheme()
See Also
Scene.Preferences#colorSchemeProperty()
systemMinHeightPropertyback to summary
public static ReadOnlyDoubleProperty systemMinHeightProperty(Stage stage)

Specifies the system-recommended minimum height for the HeaderBar for the specified Stage, which usually corresponds to the height of the default header buttons. Applications can use this value as a sensible lower limit for the height of the HeaderBar.

By default, minHeight is set to the value of systemMinHeight, unless minHeight is explicitly set by a stylesheet or application code.

Parameters
stage:Stage

the Stage

Returns:ReadOnlyDoubleProperty

the systemMinHeight attached property

javafx.scene.layout back to summary

private final Class HeaderBar.NodeProperty

extends ObjectPropertyBase<Node>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final String
private Node

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Object
getBean()

Implements javafx.beans.property.ReadOnlyProperty.getBean.

Returns the Object that contains this property.

public String
getName()

Implements javafx.beans.property.ReadOnlyProperty.getName.

Returns the name of this property.

protected void
invalidated()

Overrides javafx.beans.property.ObjectPropertyBase.invalidated.

The method invalidated() can be overridden to receive invalidation notifications.

Inherited from javafx.beans.property.ObjectPropertyBase:
addListeneraddListenerbindfireValueChangedEventgetisBoundremoveListenerremoveListenersettoStringunbind

Field Detail

nameback to summary
private final String name
valueback to summary
private Node value

Hides javafx.beans.property.ObjectPropertyBase.value.

Constructor Detail

NodePropertyback to summary
pack-priv NodeProperty(String name)

Method Detail

getBeanback to summary
public Object getBean()

Implements javafx.beans.property.ReadOnlyProperty.getBean.

Doc from javafx.beans.property.ReadOnlyProperty.getBean.

Returns the Object that contains this property. If this property is not contained in an Object, null is returned.

Annotations
@Override
getNameback to summary
public String getName()

Implements javafx.beans.property.ReadOnlyProperty.getName.

Doc from javafx.beans.property.ReadOnlyProperty.getName.

Returns the name of this property. If the property does not have a name, this method returns an empty String.

Annotations
@Override
invalidatedback to summary
protected void invalidated()

Overrides javafx.beans.property.ObjectPropertyBase.invalidated.

Doc from javafx.beans.property.ObjectPropertyBase.invalidated.

The method invalidated() can be overridden to receive invalidation notifications. This is the preferred option in Objects defining the property, because it requires less memory. The default implementation is empty.

Annotations
@Override