Top Description Fields Constructors Methods
javafx.stage

public final Enum StageStyle

extends Enum<StageStyle>
Class Inheritance
Imports
javafx.application.ConditionalFeature, .Platform, javafx.scene.Node, .Scene, javafx.scene.layout.BorderPane, .HeaderBar, .HeaderButtonType

This enum defines the possible styles for a Stage.
Since
JavaFX 2.0

Field Summary

Modifier and TypeField and Description
public static final StageStyle
DECORATED

Defines a normal Stage style with a solid white background and platform decorations.

public static final StageStyle
EXTENDED

Deprecated since 25. This is a preview feature which may be changed or removed in a future release.
Defines a Stage style in which the client area is extended into the header bar area, removing the separation between the two areas and allowing applications to place scene graph nodes in the header bar area of the stage.
public static final StageStyle
TRANSPARENT

Defines a Stage style with a transparent background and no decorations.

public static final StageStyle
UNDECORATED

Defines a Stage style with a solid white background and no window decorations, such as a title bar, borders, or window controls.

public static final StageStyle
UNIFIED

Defines a Stage style with platform decorations and eliminates the border between client area and decorations.

public static final StageStyle
UTILITY

Defines a lightweight Stage style with a solid white background and minimal decorations, intended for supporting tasks such as tool palettes.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static StageStyle
public static StageStyle[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DECORATEDback to summary
public static final StageStyle DECORATED

Defines a normal Stage style with a solid white background and platform decorations.

EXTENDEDback to summary
public static final StageStyle EXTENDED

Deprecated

since 25.

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

Defines a Stage style in which the client area is extended into the header bar area, removing the separation between the two areas and allowing applications to place scene graph nodes in the header bar area of the stage.

This is a conditional feature, to check if it is supported see Platform#isSupported(ConditionalFeature). If the feature is not supported by the platform, this style downgrades to StageStyle#DECORATED.

Usage

An extended window has the default header buttons (iconify, maximize, close), but no system-provided draggable header bar. Applications need to provide their own header bar by placing a HeaderBar control in the scene graph. The HeaderBar control should be positioned at the top of the window and its width should extend the entire width of the window, as otherwise the layout of the default window buttons and the header bar content might not be aligned correctly. Usually, HeaderBar is combined with a BorderPane root container:
public class MyApp extends Application {
    @Override
    public void start(Stage stage) {
        var headerBar = new HeaderBar();
        var root = new BorderPane();
        root.setTop(headerBar);

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

Color scheme

The color scheme of the default header buttons is automatically adjusted to remain easily recognizable by inspecting the Scene.fill property to gauge the brightness of the user interface. Applications should set the scene fill to a color that matches the user interface of the header bar area, even if the scene fill is not visible because it is obscured by other controls.

Custom header buttons

If more control over the header buttons is desired, applications can opt out of the default header buttons by setting HeaderBar#setPrefButtonHeight(Stage, double) to zero and providing custom header buttons instead. Any JavaFX control can be used as a custom header button by setting its semantic type with the HeaderBar#setButtonType(Node, HeaderButtonType) method.

Title text

An extended stage has no title text. Applications that require title text need to provide their own implementation by placing a Label or a similar control in the custom header bar. Note that the value of Stage#titleProperty() may still be used by the platform, for example in the title of miniaturized preview windows.
Annotations
@Deprecated
since:25
Since
25
TRANSPARENTback to summary
public static final StageStyle TRANSPARENT

Defines a Stage style with a transparent background and no decorations. This is a conditional feature; to check if it is supported use javafx.application.Platform#isSupported(javafx.application.ConditionalFeature). If the feature is not supported by the platform, this style downgrades to StageStyle.UNDECORATED

UNDECORATEDback to summary
public static final StageStyle UNDECORATED

Defines a Stage style with a solid white background and no window decorations, such as a title bar, borders, or window controls. This style allows window operations such as resize, minimize, maximize and fullscreen to be either programmatically controlled or achieved through platform-specific functions, such as key shortcuts or menu options.

UNIFIEDback to summary
public static final StageStyle UNIFIED

Defines a Stage style with platform decorations and eliminates the border between client area and decorations. The client area background is unified with the decorations. This is a conditional feature, to check if it is supported see javafx.application.Platform#isSupported(javafx.application.ConditionalFeature). If the feature is not supported by the platform, this style downgrades to StageStyle.DECORATED

Note

To see the effect, the Scene covering the Stage should have Color.TRANSPARENT

Since
JavaFX 8.0
UTILITYback to summary
public static final StageStyle UTILITY

Defines a lightweight Stage style with a solid white background and minimal decorations, intended for supporting tasks such as tool palettes.

Utility stages may restrict window operations like maximize, minimize, and fullscreen depending on the platform. They are designed to float above primary windows without acting as a main application stage.

Constructor Detail

StageStyleback to summary
private StageStyle()

Method Detail

valueOfback to summary
public static StageStyle valueOf(String name)
valuesback to summary
public static StageStyle[] values()