APIdia Launch Partner
Top Description Fields Constructors Methods
javafx.stage

public final Enum StageStyle

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

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

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

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. Refer to the documentation of HeaderBar for more information on how to configure the header bar area.

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();
    }
}

Title text and application icon

In an extended stage, the platform does not provide title text or an application icon in the header bar area. Applications that require either or both need to provide their own implementation, for example 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.
Since
27
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()