| Modifier and Type | Class and Description |
|---|---|
| public static interface | Platform.
Contains preferences of the current platform. |
| Modifier and Type | Field and Description |
|---|---|
| private static ReadOnlyBooleanWrapper |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static ReadOnlyBooleanProperty | Returns: the read-only boolean property indicating if accessibility is activeIndicates whether or not accessibility is active. |
| public static boolean | Returns: true if a nested event loop can be started, and false otherwise.Indicates whether a nested event loop can be started from the current thread in the current state. |
| public static Object | Returns: the value passed into the corresponding call to exitEventLoopthe Object that identifies the nested event loop, which
must not be null key)Enter a nested event loop and block until the corresponding exitNestedEventLoop call is made. |
| public static void | |
| public static void | exitNestedEventLoop(Object
the Object that identifies the nested event loop, which
must not be null key, Object an Object that is returned to the caller of the
corresponding enterNestedEventLoop. This may be null. rval)Exit a nested event loop and unblock the caller of the corresponding enterNestedEventLoop. |
| public static Platform. | |
| public static boolean | |
| public static boolean | Returns: true if running on the JavaFX Application ThreadReturns true if the calling thread is the JavaFX Application Thread. |
| public static boolean | |
| public static Optional | Returns: the lock state of the key corresponding tokeyCode,
or an empty Optional if the system cannot determine its statethe keyCode)KeyCode of the lock state to queryReturns a flag indicating whether the key corresponding to |
| public static boolean | Returns: true if there is a nested event loop running, and false otherwise.Checks whether a nested event loop is running, returning true to indicate that one is, and false if there are no nested event loops currently running. |
| public static boolean | Returns: true if a specific conditional feature is supported by the platform, otherwise falsethe conditional feature in question. feature)Queries whether a specific conditional feature is supported by the platform. |
| public static void | |
| public static void | |
| public static void | setImplicitExit(boolean
a flag indicating whether or not to implicitly exit
when the last window is closed. implicitExit)Sets the implicitExit attribute to the specified value. |
| public static void |
| accessibilityActiveProperty | back to summary |
|---|---|
| private static ReadOnlyBooleanWrapper accessibilityActiveProperty | |
| Platform | back to summary |
|---|---|
| private Platform() | |
| accessibilityActiveProperty | back to summary |
|---|---|
| public static ReadOnlyBooleanProperty accessibilityActiveProperty() Indicates whether or not accessibility is active. This property is typically set to true the first time an assistive technology, such as a screen reader, requests information about any JavaFX window or its children. This property can be accessed only from the JavaFX Application Thread.
| |
| canStartNestedEventLoop | back to summary |
|---|---|
| public static boolean canStartNestedEventLoop() Indicates whether a nested event loop can be started from the current thread in the current state.
A nested event loop can be started from an event handler or from a
| |
| enterNestedEventLoop | back to summary |
|---|---|
| public static Object enterNestedEventLoop(Object key) Enter a nested event loop and block until the corresponding
exitNestedEventLoop call is made.
The key passed into this method is used to
uniquely identify the matched enter/exit pair. This method creates a
new nested event loop and blocks until the corresponding
exitNestedEventLoop method is called with the same key.
The return value of this method will be the
This method must either be called from an input event handler or
from the run method of a Runnable passed to
canStartNestedEventLoop to check
whether it is possible to start one.
| |
| exit | back to summary |
|---|---|
| public static void exit() Causes the JavaFX application to terminate. If this method is called after the Application start method is called, then the JavaFX launcher will call the Application stop method and terminate the JavaFX application thread. The launcher thread will then shutdown. If there are no other non-daemon threads that are running, the Java VM will exit. If this method is called from the Preloader or the Application init method, then the Application stop method may not be called. This method may be called from any thread. | |
| exitNestedEventLoop | back to summary |
|---|---|
| public static void exitNestedEventLoop(Object key, Object rval) Exit a nested event loop and unblock the caller of the corresponding enterNestedEventLoop. The key passed into this method is used to uniquely identify the matched enter/exit pair. This method causes the nested event loop that was previously created with the key to exit and return control to the caller. If the specified nested event loop is not the inner-most loop then it will not return until all other inner loops also exit.
| |
| getPreferences | back to summary |
|---|---|
| public static Platform. Gets the preferences of the current platform.
The map returned from this method is unmodifiable, which means that keys and values cannot
be added, removed, or updated. Calling any mutator method on the map will always cause
| |
| isAccessibilityActive | back to summary |
|---|---|
| public static boolean isAccessibilityActive() | |
| isFxApplicationThread | back to summary |
|---|---|
| public static boolean isFxApplicationThread() Returns true if the calling thread is the JavaFX Application Thread. Use this call to ensure that a given task is being executed (or not being executed) on the JavaFX Application Thread.
| |
| isImplicitExit | back to summary |
|---|---|
| public static boolean isImplicitExit() Gets the value of the implicitExit attribute. This method may be called from any thread.
| |
| isKeyLocked | back to summary |
|---|---|
| public static Optional Returns a flag indicating whether the key corresponding to
| |
| isNestedLoopRunning | back to summary |
|---|---|
| public static boolean isNestedLoopRunning() Checks whether a nested event loop is running, returning true to indicate that one is, and false if there are no nested event loops currently running. This method must be called on the JavaFX Application thread.
| |
| isSupported | back to summary |
|---|---|
| public static boolean isSupported(ConditionalFeature feature) Queries whether a specific conditional feature is supported by the platform. For example:
// Query whether filter effects are supported
if (Platform.isSupported(ConditionalFeature.EFFECT)) {
// use effects
}
| |
| requestNextPulse | back to summary |
|---|---|
| public static void requestNextPulse() Requests the Java Runtime to perform a pulse. This will run a pulse even if there are no animation timers, scene graph modifications, or window events that would otherwise cause the pulse to run. If no pulse is in progress, then one will be scheduled to run the next time the pulse timer fires. If there is already a pulse running, then at least one more pulse after the current pulse will be scheduled. This method may be called on any thread.
| |
| runLater | back to summary |
|---|---|
| public static void runLater(Runnable runnable) Run the specified Runnable on the JavaFX Application Thread at some unspecified time in the future. This method, which may be called from any thread, will post the Runnable to an event queue and then return immediately to the caller. The Runnables are executed in the order they are posted. A runnable passed into the runLater method will be executed before any Runnable passed into a subsequent call to runLater. If this method is called after the JavaFX runtime has been shutdown, the call will be ignored: the Runnable will not be executed and no exception will be thrown. Note applications should avoid flooding JavaFX with too many pending Runnables. Otherwise, the application may become unresponsive. Applications are encouraged to batch up multiple operations into fewer runLater calls. Additionally, long-running operations should be done on a background thread where possible, freeing up the JavaFX Application Thread for GUI operations.
This method must not be called before the FX runtime has been
initialized. For standard JavaFX applications that extend
Memory consistency effects: Actions in a thread prior to submitting a
| |
| setImplicitExit | back to summary |
|---|---|
| public static void setImplicitExit(boolean implicitExit) Sets the implicitExit attribute to the specified value. If this
attribute is true, the JavaFX runtime will implicitly shutdown
when the last window is closed; the JavaFX launcher will call the
This method may be called from any thread.
| |
| startup | back to summary |
|---|---|
| public static void startup(Runnable runnable) This method starts the JavaFX runtime. The specified Runnable will then be called on the JavaFX Application Thread. In general it is not necessary to explicitly call this method, since it is invoked as a consequence of how most JavaFX applications are built. However there are valid use cases for calling this method directly. Because this method starts the JavaFX runtime, there is not yet any JavaFX Application Thread, so it is normal that this method is called directly on the main thread of the application.
This method may or may not return to the caller before the run method
of the specified Runnable has been called. In any case, this
method is not blocked on the specified Runnable being executed.
Once this method
returns, you may call As noted, it is normally the case that the JavaFX Application Thread is started automatically. It is important that this method only be called when the JavaFX runtime has not yet been initialized. Situations where the JavaFX runtime is started automatically include:
When an application does not follow any of these common approaches, then it becomes the responsibility of the developer to manually start the JavaFX runtime by calling this startup method. Calling this method when the JavaFX runtime is already running will result in an
Note The JavaFX classes must be loaded from a set of
named
| |
Preferences extends ObservableMap to expose platform preferences as key-value pairs.
The map is unmodifiable, which means that keys and values cannot be added, removed, or updated.
Calling any mutator method on the map will always cause UnsupportedOperationException to be thrown.
However, the mappings will be updated by JavaFX when the operating system reports that a platform
preference has changed.
For convenience, getInteger, getDouble, getBoolean, getString,
getColor, and getValue are provided as typed alternatives to the untyped
get method.
The preferences that are reported by the platform may be dependent on the operating system version and its current configuration, so applications should not assume that a particular preference is always available.
The following preferences are potentially available on the specified platforms:
Windows.SPI.HighContrast | Boolean |
Windows.SPI.HighContrastColorScheme | String |
Windows.SPI.ClientAreaAnimation | Boolean |
Windows.SysColor.COLOR_3DFACE | Color |
Windows.SysColor.COLOR_BTNTEXT | Color |
Windows.SysColor.COLOR_GRAYTEXT | Color |
Windows.SysColor.COLOR_HIGHLIGHT | Color |
Windows.SysColor.COLOR_HIGHLIGHTTEXT | Color |
Windows.SysColor.COLOR_HOTLIGHT | Color |
Windows.SysColor.COLOR_WINDOW | Color |
Windows.SysColor.COLOR_WINDOWTEXT | Color |
Windows.UIColor.Background | Color |
Windows.UIColor.Foreground | Color |
Windows.UIColor.AccentDark3 | Color |
Windows.UIColor.AccentDark2 | Color |
Windows.UIColor.AccentDark1 | Color |
Windows.UIColor.Accent | Color |
Windows.UIColor.AccentLight1 | Color |
Windows.UIColor.AccentLight2 | Color |
Windows.UIColor.AccentLight3 | Color |
Windows.UISettings.AdvancedEffectsEnabled | Boolean |
Windows.UISettings.AutoHideScrollBars | Boolean |
Windows.NetworkInformation.InternetCostType | String |
macOS.NSColor.labelColor | Color |
macOS.NSColor.secondaryLabelColor | Color |
macOS.NSColor.tertiaryLabelColor | Color |
macOS.NSColor.quaternaryLabelColor | Color |
macOS.NSColor.textColor | Color |
macOS.NSColor.placeholderTextColor | Color |
macOS.NSColor.selectedTextColor | Color |
macOS.NSColor.textBackgroundColor | Color |
macOS.NSColor.selectedTextBackgroundColor | Color |
macOS.NSColor.keyboardFocusIndicatorColor | Color |
macOS.NSColor.unemphasizedSelectedTextColor | Color |
macOS.NSColor.unemphasizedSelectedTextBackgroundColor | Color |
macOS.NSColor.linkColor | Color |
macOS.NSColor.separatorColor | Color |
macOS.NSColor.selectedContentBackgroundColor | Color |
macOS.NSColor.unemphasizedSelectedContentBackgroundColor | Color |
macOS.NSColor.selectedMenuItemTextColor | Color |
macOS.NSColor.gridColor | Color |
macOS.NSColor.headerTextColor | Color |
macOS.NSColor.alternatingContentBackgroundColors | Color[] |
macOS.NSColor.controlAccentColor | Color |
macOS.NSColor.controlColor | Color |
macOS.NSColor.controlBackgroundColor | Color |
macOS.NSColor.controlTextColor | Color |
macOS.NSColor.disabledControlTextColor | Color |
macOS.NSColor.selectedControlColor | Color |
macOS.NSColor.selectedControlTextColor | Color |
macOS.NSColor.alternateSelectedControlTextColor | Color |
macOS.NSColor.currentControlTint | String |
macOS.NSColor.windowBackgroundColor | Color |
macOS.NSColor.windowFrameTextColor | Color |
macOS.NSColor.underPageBackgroundColor | Color |
macOS.NSColor.findHighlightColor | Color |
macOS.NSColor.highlightColor | Color |
macOS.NSColor.shadowColor | Color |
macOS.NSColor.systemBlueColor | Color |
macOS.NSColor.systemBrownColor | Color |
macOS.NSColor.systemGrayColor | Color |
macOS.NSColor.systemGreenColor | Color |
macOS.NSColor.systemIndigoColor | Color |
macOS.NSColor.systemOrangeColor | Color |
macOS.NSColor.systemPinkColor | Color |
macOS.NSColor.systemPurpleColor | Color |
macOS.NSColor.systemRedColor | Color |
macOS.NSColor.systemTealColor | Color |
macOS.NSColor.systemYellowColor | Color |
macOS.NSWorkspace.accessibilityDisplayShouldReduceMotion | Boolean |
macOS.NSWorkspace.accessibilityDisplayShouldReduceTransparency | Boolean |
macOS.NSScroller.preferredScrollerStyle | String |
macOS.NWPathMonitor.currentPathConstrained | Boolean |
macOS.NWPathMonitor.currentPathExpensive | Boolean |
GTK.theme_name | String |
GTK.theme_fg_color | Color |
GTK.theme_bg_color | Color |
GTK.theme_base_color | Color |
GTK.theme_selected_bg_color | Color |
GTK.theme_selected_fg_color | Color |
GTK.theme_unfocused_fg_color | Color |
GTK.theme_unfocused_bg_color | Color |
GTK.theme_unfocused_base_color | Color |
GTK.theme_unfocused_selected_bg_color | Color |
GTK.theme_unfocused_selected_fg_color | Color |
GTK.insensitive_bg_color | Color |
GTK.insensitive_fg_color | Color |
GTK.insensitive_base_color | Color |
GTK.borders | Color |
GTK.unfocused_borders | Color |
GTK.warning_color | Color |
GTK.error_color | Color |
GTK.success_color | Color |
GTK.enable_animations | Boolean |
GTK.overlay_scrolling | Boolean |
GTK.network_metered | Boolean |
| Modifier and Type | Method and Description |
|---|---|
| public ReadOnlyObjectProperty | Returns: theaccentColor propertyThe accent color, which can be used to highlight the active or important part of a control and make it stand out from the rest of the user interface. |
| public ReadOnlyObjectProperty | Returns: thebackgroundColor propertyThe color used for background regions. |
| public ReadOnlyObjectProperty | Returns: thecolorScheme propertyThe platform color scheme, which specifies whether applications should prefer light text on dark backgrounds, or dark text on light backgrounds. |
| public ReadOnlyObjectProperty | Returns: theforegroundColor propertyThe color used for foreground elements like text. |
| public Color | |
| public Color | |
| public Optional | Returns: the optionalBoolean to which the key is mappedthe key key)Returns an optional |
| public Optional | |
| public ColorScheme | |
| public Optional | |
| public Color | |
| public Optional | Returns: the optionalInteger to which the key is mappedthe key key)Returns an optional |
| public Optional | |
| public < the type of the value T> Optional | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public ReadOnlyBooleanProperty | Returns: thepersistentScrollBars propertySpecifies whether applications should always show scroll bars. |
| public ReadOnlyBooleanProperty | Returns: thereducedData propertySpecifies whether applications should minimize the amount of internet traffic, which users might request because they are on a metered network or a limited data plan. |
| public ReadOnlyBooleanProperty | Returns: thereducedMotion propertySpecifies whether applications should minimize the amount of non-essential animations, reducing discomfort for users who experience motion sickness or vertigo. |
| public ReadOnlyBooleanProperty | Returns: thereducedTransparency propertySpecifies whether applications should minimize the amount of transparent or translucent layer effects, which can help to increase contrast and readability for some users. |
| accentColorProperty | back to summary |
|---|---|
| public ReadOnlyObjectProperty The accent color, which can be used to highlight the active or important part of a control and make it stand out from the rest of the user interface. It is usually a vivid color that contrasts with the foreground and background colors.
| |
| backgroundColorProperty | back to summary |
|---|---|
| public ReadOnlyObjectProperty The color used for background regions.
| |
| colorSchemeProperty | back to summary |
|---|---|
| public ReadOnlyObjectProperty The platform color scheme, which specifies whether applications should prefer light text on dark backgrounds, or dark text on light backgrounds.
This property corresponds to the
| |
| foregroundColorProperty | back to summary |
|---|---|
| public ReadOnlyObjectProperty The color used for foreground elements like text.
| |
| getAccentColor | back to summary |
|---|---|
| public Color getAccentColor() | |
| getBackgroundColor | back to summary |
|---|---|
| public Color getBackgroundColor() | |
| getBoolean | back to summary |
|---|---|
| public Optional Returns an optional
| |
| getColor | back to summary |
|---|---|
| public Optional Returns an optional
| |
| getColorScheme | back to summary |
|---|---|
| public ColorScheme getColorScheme() | |
| getDouble | back to summary |
|---|---|
| public Optional Returns an optional
| |
| getForegroundColor | back to summary |
|---|---|
| public Color getForegroundColor() | |
| getInteger | back to summary |
|---|---|
| public Optional Returns an optional
| |
| getString | back to summary |
|---|---|
| public Optional Returns an optional
| |
| getValue | back to summary |
|---|---|
| public <T> Optional Returns an optional value to which the specified key is mapped.
| |
| isPersistentScrollBars | back to summary |
|---|---|
| public boolean isPersistentScrollBars() | |
| isReducedData | back to summary |
|---|---|
| public boolean isReducedData() | |
| isReducedMotion | back to summary |
|---|---|
| public boolean isReducedMotion() | |
| isReducedTransparency | back to summary |
|---|---|
| public boolean isReducedTransparency() | |
| persistentScrollBarsProperty | back to summary |
|---|---|
| public ReadOnlyBooleanProperty persistentScrollBarsProperty() Specifies whether applications should always show scroll bars. If not set, an application may choose to hide scroll bars that are not actively used, or make them smaller or less noticeable.
This property corresponds to the
| |
| reducedDataProperty | back to summary |
|---|---|
| public ReadOnlyBooleanProperty reducedDataProperty() Specifies whether applications should minimize the amount of internet traffic, which users might request because they are on a metered network or a limited data plan.
This property corresponds to the
| |
| reducedMotionProperty | back to summary |
|---|---|
| public ReadOnlyBooleanProperty reducedMotionProperty() Specifies whether applications should minimize the amount of non-essential animations, reducing discomfort for users who experience motion sickness or vertigo.
This property corresponds to the
| |
| reducedTransparencyProperty | back to summary |
|---|---|
| public ReadOnlyBooleanProperty reducedTransparencyProperty() Specifies whether applications should minimize the amount of transparent or translucent layer effects, which can help to increase contrast and readability for some users.
This property corresponds to the
| |