Enum Class StageStyle

java.lang.Object
java.lang.Enum<StageStyle>
javafx.stage.StageStyle
All Implemented Interfaces:
Serializable, Comparable<StageStyle>, Constable

public enum StageStyle extends Enum<StageStyle>
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 Constants
    Enum Constant
    Description
    Defines a normal Stage 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 a Stage style with a transparent background and no decorations.
    Defines a Stage style with a solid white background and no window decorations, such as a title bar, borders, or window controls.
    Defines a Stage style with platform decorations and eliminates the border between client area and decorations.
    Defines a lightweight Stage style with a solid white background and minimal decorations, intended for supporting tasks such as tool palettes.
  • Method Summary

    Modifier and Type
    Method
    Description
    static StageStyle
    Returns the enum constant of this class with the specified name.
    static StageStyle[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods declared in class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • DECORATED

      public static final StageStyle DECORATED
      Defines a normal Stage style with a solid white background and platform decorations.
    • UNDECORATED

      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.
    • TRANSPARENT

      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 Platform.isSupported(javafx.application.ConditionalFeature). If the feature is not supported by the platform, this style downgrades to StageStyle.UNDECORATED
    • UTILITY

      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.

    • UNIFIED

      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 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
    • EXTENDED

      @Deprecated(since="25") public static final StageStyle EXTENDED
      Deprecated.
      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 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.
      Since:
      25
  • Method Details

    • values

      public static StageStyle[] 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

      public static StageStyle valueOf(String name)
      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 name
      NullPointerException - if the argument is null