Enum Class StageStyle
- All Implemented Interfaces:
Serializable
,Comparable<StageStyle>
,Constable
This enum defines the possible styles for a
Stage
.- Since:
- JavaFX 2.0
-
Nested Class Summary
Nested classes/interfaces declared in class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDefines a normalStage
style with a solid white background and platform decorations.Deprecated.This is a preview feature which may be changed or removed in a future release.Defines aStage
style with a transparent background and no decorations.Defines aStage
style with a solid white background and no window decorations, such as a title bar, borders, or window controls.Defines aStage
style with platform decorations and eliminates the border between client area and decorations.Defines a lightweightStage
style with a solid white background and minimal decorations, intended for supporting tasks such as tool palettes. -
Method Summary
Modifier and TypeMethodDescriptionstatic StageStyle
Returns the enum constant of this class with the specified name.static StageStyle[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DECORATED
Defines a normalStage
style with a solid white background and platform decorations. -
UNDECORATED
Defines aStage
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. -
TRANSPARENT
Defines aStage
style with a transparent background and no decorations. This is a conditional feature; to check if it is supported usePlatform.isSupported(javafx.application.ConditionalFeature)
. If the feature is not supported by the platform, this style downgrades toStageStyle.UNDECORATED
-
UTILITY
Defines a lightweightStage
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.
-
UNIFIED
Defines aStage
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 seePlatform.isSupported(javafx.application.ConditionalFeature)
. If the feature is not supported by the platform, this style downgrades toStageStyle.DECORATED
NOTE: To see the effect, the
Scene
covering theStage
should haveColor.TRANSPARENT
- Since:
- JavaFX 8.0
-
EXTENDED
Deprecated.This is a preview feature which may be changed or removed in a future release.Defines aStage
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 toDECORATED
.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 aHeaderBar
control in the scene graph. TheHeaderBar
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 aBorderPane
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 theScene.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 settingHeaderBar.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 theHeaderBar.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 aLabel
or a similar control in the custom header bar. Note that the value ofStage.titleProperty()
may still be used by the platform, for example in the title of miniaturized preview windows.- Since:
- 25
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-