Top Description Inners Fields Constructors Methods
javafx.scene.layout

public Class HeaderBar

extends Region
Class Inheritance
Annotations
@Deprecated
since:25
Imports
com.sun.javafx.PreviewFeature, com.sun.javafx.geom.Vec2d, com.sun.javafx.scene.layout.HeaderButtonBehavior, com.sun.javafx.stage.HeaderButtonMetrics, .StageHelper, javafx.beans.property.BooleanProperty, .BooleanPropertyBase, .ObjectProperty, .ObjectPropertyBase, .ReadOnlyDoubleProperty, .ReadOnlyDoubleWrapper, .ReadOnlyObjectProperty, .ReadOnlyObjectWrapper, javafx.beans.value.ObservableValue, javafx.css.StyleableDoubleProperty, javafx.event.Event, javafx.geometry.Dimension2D, .HPos, .Insets, .NodeOrientation, .Orientation, .Pos, .VPos, javafx.scene.Node, .Scene, javafx.scene.input.ContextMenuEvent, .MouseEvent, javafx.stage.Stage, .StageStyle, javafx.util.Subscription

Deprecated

since 25.

This is a preview feature which may be changed or removed in a future release.

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 setDragType(Node, HeaderDragType) method.

HeaderBar is a layout container that allows applications to place scene graph nodes in three areas: leading, center, and trailing. All areas can be null. The default minHeight of the HeaderBar is set to match the height of the platform-specific default 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 area reserved for the system-provided window 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 incorrectly adds additional padding between the two header bars. In this case, the leadingSystemPadding and trailingSystemPadding properties can be used to remove the padding that is not needed.

Header button height

Applications can specify the preferred height for system-provided header buttons by setting the static setPrefButtonHeight(Stage, double) property on 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.

Custom header buttons

If more control over the header buttons is desired, applications can opt out of the system-provided header buttons by setting setPrefButtonHeight(Stage, double) 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 setting its semantic type with the setButtonType(Node, HeaderButtonType) method.

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 leading and trailing 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 be 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 like 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
25

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

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

The center area of the HeaderBar.

private boolean
private HeaderButtonMetrics
private static final String
private static final Dimension2D
private final ObjectProperty<Node>
leading

The leading area of the HeaderBar.

private final BooleanProperty
leadingSystemPadding

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

private final ReadOnlyObjectWrapper<Dimension2D>
leftSystemInset

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

private static final String
private final ReadOnlyDoubleWrapper
minSystemHeight

The system-provided minimum recommended height for the HeaderBar, which usually corresponds to the height of the default header buttons.

private final ReadOnlyObjectWrapper<Dimension2D>
rightSystemInset

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

private Subscription
private final ObjectProperty<Node>
trailing

The trailing area of the HeaderBar.

private final BooleanProperty
trailingSystemPadding

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

public static final double
USE_DEFAULT_SIZE

Sentinel value that can be used for setPrefButtonHeight(Stage, double) 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 leading node, or null
leading
,
Node
the center node, or null
center
,
Node
the trailing node, or null
trailing
)

Creates a new HeaderBar with the specified children.

Method Summary

Modifier and TypeMethod and Description
private Insets
adjustMarginForRTL(Insets margin, boolean rtl)

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 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
)
References Deprecated HeaderButtonType is deprecated or references (maybe indirectly) at least one deprecated element.

Returns the HeaderButtonType of the specified child.

public final Node
public static HeaderDragType

Returns:

the HeaderDragType, or null if not set
getDragType
(Node
the child node
child
)
References Deprecated HeaderDragType is deprecated or references (maybe indirectly) at least one deprecated element.

Returns the HeaderDragType of the specified child.

public final Node
public final Dimension2D
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.

public final double
private Insets
public static double

Returns:

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

Returns the preferred height of the system-provided header buttons of the specified stage.

public final Dimension2D
public final Node
public final boolean
private boolean
private 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 final BooleanProperty
public final ReadOnlyObjectProperty<Dimension2D>
public final ReadOnlyDoubleProperty
private void
onFullScreenChanged(boolean fullScreen)

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

public final ReadOnlyObjectProperty<Dimension2D>
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
)
References Deprecated HeaderButtonType is deprecated or references (maybe indirectly) at least one deprecated element.

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

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
)
References Deprecated HeaderDragType is deprecated or references (maybe indirectly) at least one deprecated element.

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

public final void
public final void
setLeadingSystemPadding(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 static void
setPrefButtonHeight(Stage
the Stage
stage
,
double
the preferred height, or 0 to hide the system-provided header buttons
height
)

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

public final void
public final void
setTrailingSystemPadding(boolean value)

public final ObjectProperty<Node>
public final BooleanProperty
private void
public boolean
usesMirroring()

Overrides javafx.scene.Node.usesMirroring.

Determines whether a node should be mirrored when node orientation is right-to-left.

Inherited from javafx.scene.layout.Region:
addImageListeneradjustHeightByMarginadjustWidthByMarginbackgroundPropertyborderPropertyboundedNodeSizeWithBiasboundedSizecacheShapePropertycenterShapePropertycomputeChildMaxAreaHeightcomputeChildMaxAreaWidthcomputeChildMinAreaHeightcomputeChildMinAreaHeightcomputeChildMinAreaWidthcomputeChildMinAreaWidthcomputeChildPrefAreaHeightcomputeChildPrefAreaHeightcomputeChildPrefAreaWidthcomputeChildPrefAreaWidthcomputeMaxHeightcomputeMaxMinAreaHeightcomputeMaxMinAreaHeightcomputeMaxMinAreaHeightcomputeMaxMinAreaWidthcomputeMaxMinAreaWidthcomputeMaxMinAreaWidthcomputeMaxPrefAreaHeightcomputeMaxPrefAreaHeightcomputeMaxPrefAreaHeightcomputeMaxPrefAreaWidthcomputeMaxPrefAreaWidthcomputeMaxPrefAreaWidthcomputeMaxWidthcomputePrefWidthcomputeXOffsetcomputeYOffsetcreateDoubleArraygetAreaBaselineOffsetgetAreaBaselineOffsetgetAreaBaselineOffsetgetAreaBaselineOffsetgetAreaBaselineOffsetgetAreaBaselineOffsetgetBackgroundgetBordergetClassCssMetaDatagetCssMetaDatagetHeightgetInsetsgetMaxBaselineComplementgetMaxHeightgetMaxWidthgetMinBaselineComplementgetMinHeightgetMinWidthgetOpaqueInsetsgetPaddinggetPrefBaselineComplementgetPrefHeightgetPrefWidthgetShapegetSnapScaleXgetSnapScaleYgetUserAgentStylesheetgetWidthheightPropertyinsetsPropertyisCacheShapeisCenterShapeisResizableisScaleShapeisSnapToPixellayoutInArealayoutInArealayoutInArealayoutInAreamaxHeightmaxHeightPropertymaxWidthmaxWidthPropertyminHeightminHeightPropertyminWidthminWidthPropertyopaqueInsetsPropertypaddingPropertypositionInAreapositionInAreaprefHeightprefHeightPropertyprefWidthprefWidthPropertyremoveImageListenerresizescaleShapePropertysetBackgroundsetBordersetCacheShapesetCenterShapesetHeightsetMaxHeightsetMaxSizesetMaxWidthsetMinHeightsetMinSizesetMinWidthsetOpaqueInsetssetPaddingsetPrefHeightsetPrefSizesetPrefWidthsetScaleShapesetShapesetSnapToPixelsetWidthshapePropertysnappedBottomInsetsnappedLeftInsetsnappedRightInsetsnappedTopInsetsnapPortionXsnapPortionYsnapPositionsnapPositionXsnapPositionYsnapSizesnapSizeXsnapSizeYsnapSpacesnapSpaceXsnapSpaceYsnapToPixelPropertywidthProperty

Field Detail

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

The center area of the HeaderBar.

Default Value
null
currentFullScreenback to summary
private boolean currentFullScreen
currentMetricsback to summary
private HeaderButtonMetrics currentMetrics
DRAG_TYPEback to summary
private static final String DRAG_TYPE
EMPTYback to summary
private static final Dimension2D EMPTY
leadingback to summary
private final ObjectProperty<Node> leading

The leading area of the HeaderBar.

The leading area corresponds to the left area in a left-to-right layout, and to the right area in a right-to-left layout.

Default Value
null
leadingSystemPaddingback to summary
private final BooleanProperty leadingSystemPadding

Specifies whether additional padding should be added to the leading 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 leading 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
trailingSystemPadding
leftSystemInsetback to summary
private final ReadOnlyObjectWrapper<Dimension2D> leftSystemInset

Describes the size of the left system-reserved inset, 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.

Note that the left system inset refers to the left side of the window, independent of layout orientation.

MARGINback to summary
private static final String MARGIN
minSystemHeightback to summary
private final ReadOnlyDoubleWrapper minSystemHeight

The system-provided minimum recommended height for the HeaderBar, 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 minSystemHeight, unless minHeight is explicitly set by a stylesheet or application code.

rightSystemInsetback to summary
private final ReadOnlyObjectWrapper<Dimension2D> rightSystemInset

Describes the size of the right system-reserved inset, 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.

Note that the right system inset refers to the right side of the window, independent of layout orientation.

subscriptionback to summary
private Subscription subscription
trailingback to summary
private final ObjectProperty<Node> trailing

The trailing area of the HeaderBar.

The trailing area corresponds to the right area in a left-to-right layout, and to the left area in a right-to-left layout.

Default Value
null
trailingSystemPaddingback to summary
private final BooleanProperty trailingSystemPadding

Specifies whether additional padding should be added to the trailing 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 trailing 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
leadingSystemPadding
USE_DEFAULT_SIZEback to summary
public static final double USE_DEFAULT_SIZE

Sentinel value that can be used for setPrefButtonHeight(Stage, double) 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 leading, Node center, Node trailing)

Creates a new HeaderBar with the specified children.

Parameters
leading:Node

the leading node, or null

center:Node

the center node, or null

trailing:Node

the trailing node, or null

Method Detail

adjustMarginForRTLback to summary
private Insets adjustMarginForRTL(Insets margin, boolean rtl)
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
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)

References Deprecated

HeaderButtonType is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Returns the HeaderButtonType of the specified child.

Parameters
child:Node

the child node

Returns:HeaderButtonType

the HeaderButtonType, or null

getCenterback to summary
public final Node getCenter()
getDragTypeback to summary
public static HeaderDragType getDragType(Node child)

References Deprecated

HeaderDragType is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Returns the HeaderDragType of the specified child.

Parameters
child:Node

the child node

Returns:HeaderDragType

the HeaderDragType, or null if not set

getLeadingback to summary
public final Node getLeading()
getLeftSystemInsetback to summary
public final Dimension2D getLeftSystemInset()
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

getMinSystemHeightback to summary
public final double getMinSystemHeight()
getNodeMarginback to summary
private Insets getNodeMargin(Node child)
getPrefButtonHeightback to summary
public static double getPrefButtonHeight(Stage stage)

Returns the preferred height of the system-provided header buttons of the specified stage.

Parameters
stage:Stage

the Stage

Returns:double

the preferred height of the system-provided header buttons

getRightSystemInsetback to summary
public final Dimension2D getRightSystemInset()
getTrailingback to summary
public final Node getTrailing()
isLeadingSystemPaddingback to summary
public final boolean isLeadingSystemPadding()
isLeftSystemPaddingback to summary
private boolean isLeftSystemPadding(NodeOrientation nodeOrientation)
isRightSystemPaddingback to summary
private boolean isRightSystemPadding(NodeOrientation nodeOrientation)
isTrailingSystemPaddingback to summary
public final boolean isTrailingSystemPadding()
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
leadingPropertyback to summary
public final ObjectProperty<Node> leadingProperty()
leadingSystemPaddingPropertyback to summary
public final BooleanProperty leadingSystemPaddingProperty()
leftSystemInsetPropertyback to summary
public final ReadOnlyObjectProperty<Dimension2D> leftSystemInsetProperty()
minSystemHeightPropertyback to summary
public final ReadOnlyDoubleProperty minSystemHeightProperty()
onFullScreenChangedback to summary
private void onFullScreenChanged(boolean fullScreen)
onMetricsChangedback to summary
private void onMetricsChanged(HeaderButtonMetrics metrics)
onStageChangedback to summary
private void onStageChanged(Stage stage)
resizeChildback to summary
private double resizeChild(Node child, double adjustedWidth, boolean fillWidth, double insideHeight, Insets margin)
rightSystemInsetPropertyback to summary
public final ReadOnlyObjectProperty<Dimension2D> rightSystemInsetProperty()
setAlignmentback to summary
public static void setAlignment(Node child, Pos value)

Sets the alignment for the child when contained in a HeaderBar. If set, 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)

References Deprecated

HeaderButtonType is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

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

This property can be set on any Node. Specifying a header button type 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

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)

References Deprecated

HeaderDragType is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

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

Setting the value to null will remove the flag.

Parameters
child:Node

the child node

value:HeaderDragType

the HeaderDragType, or null to remove the flag

setLeadingback to summary
public final void setLeading(Node value)
setLeadingSystemPaddingback to summary
public final void setLeadingSystemPadding(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

setPrefButtonHeightback to summary
public static void setPrefButtonHeight(Stage stage, double height)

Specifies the preferred height of the system-provided header buttons of 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

height:double

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

setTrailingback to summary
public final void setTrailing(Node value)
setTrailingSystemPaddingback to summary
public final void setTrailingSystemPadding(boolean value)
trailingPropertyback to summary
public final ObjectProperty<Node> trailingProperty()
trailingSystemPaddingPropertyback to summary
public final BooleanProperty trailingSystemPaddingProperty()
updateInsetsback to summary
private void updateInsets()
usesMirroringback to summary
public boolean usesMirroring()

Overrides javafx.scene.Node.usesMirroring.

Doc from javafx.scene.Node.usesMirroring.

Determines whether a node should be mirrored when node orientation is right-to-left.

When a node is mirrored, the origin is automatically moved to the top right corner causing the node to layout children and draw from right to left using a mirroring transformation. Some nodes may wish to draw from right to left without using a transformation. These nodes will answer false and implement right-to-left orientation without using the automatic transformation.

Annotations
@Override
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