Top Description Inners Fields Constructors Methods
javafx.application

public final Class Platform

extends Object
Class Inheritance
Imports
com.sun.javafx.application.PlatformImpl, com.sun.javafx.tk.Toolkit, java.util.Optional, javafx.beans.property.ReadOnlyBooleanProperty, .ReadOnlyBooleanWrapper, .ReadOnlyObjectProperty, javafx.collections.ObservableMap, javafx.scene.input.KeyCode, javafx.scene.paint.Color

Application platform support class.
Since
JavaFX 2.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
Platform.Preferences

Contains preferences of the current platform.

Field Summary

Modifier and TypeField and Description
private static ReadOnlyBooleanWrapper

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ReadOnlyBooleanProperty

Returns:

the read-only boolean property indicating if accessibility is active
accessibilityActiveProperty
()

Indicates whether or not accessibility is active.

public static boolean

Returns:

true if a nested event loop can be started, and false otherwise.
canStartNestedEventLoop
()

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 exitEventLoop
enterNestedEventLoop
(Object
the 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
exit()

Causes the JavaFX application to terminate.

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.Preferences

Returns:

the Preferences instance
getPreferences
()

Gets the preferences of the current platform.

public static boolean
public static boolean

Returns:

true if running on the JavaFX Application Thread
isFxApplicationThread
()

Returns true if the calling thread is the JavaFX Application Thread.

public static boolean

Returns:

the implicitExit attribute
isImplicitExit
()

Gets the value of the implicitExit attribute.

public static Optional<Boolean>

Returns:

the lock state of the key corresponding to keyCode, or an empty Optional if the system cannot determine its state
isKeyLocked
(KeyCode
the KeyCode of the lock state to query
keyCode
)

Returns a flag indicating whether the key corresponding to keyCode is in the locked (or "on") state.

public static boolean

Returns:

true if there is a nested event loop running, and false otherwise.
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.

public static boolean

Returns:

true if a specific conditional feature is supported by the platform, otherwise false
isSupported
(ConditionalFeature
the conditional feature in question.
feature
)

Queries whether a specific conditional feature is supported by the platform.

public static void
requestNextPulse()

Requests the Java Runtime to perform a pulse.

public static void
runLater(Runnable
the Runnable whose run method will be executed on the JavaFX Application Thread
runnable
)

Run the specified Runnable on the JavaFX Application Thread at some unspecified time in the future.

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
startup(Runnable
the Runnable whose run method will be executed on the JavaFX Application Thread once it has been started
runnable
)

This method starts the JavaFX runtime.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

accessibilityActivePropertyback to summary
private static ReadOnlyBooleanWrapper accessibilityActiveProperty

Constructor Detail

Platformback to summary
private Platform()

Method Detail

accessibilityActivePropertyback 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 method may be called from any thread.

Returns:ReadOnlyBooleanProperty

the read-only boolean property indicating if accessibility is active

Since
JavaFX 8u40
canStartNestedEventLoopback 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 Runnable passed to runLater(Runnable). This method must be called on the JavaFX Application thread.

Returns:boolean

true if a nested event loop can be started, and false otherwise.

Exceptions
IllegalStateException:
if this method is called on a thread other than the JavaFX Application Thread.
Since
21
enterNestedEventLoopback 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 rval object supplied to the exitNestedEventLoop method call that unblocks it.

This method must either be called from an input event handler or from the run method of a Runnable passed to Platform.runLater. It must not be called during animation or layout processing.

Parameters
key:Object

the Object that identifies the nested event loop, which must not be null

Returns:Object

the value passed into the corresponding call to exitEventLoop

Exceptions
IllegalArgumentException:
if the specified key is associated with a nested event loop that has not yet returned
NullPointerException:
if the key is null
IllegalStateException:
  • if this method is called during animation or layout processing.
  • if this method is called on a thread other than the JavaFX Application Thread.
Since
9
exitback 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.

exitNestedEventLoopback 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.

Parameters
key:Object

the Object that identifies the nested event loop, which must not be null

rval:Object

an Object that is returned to the caller of the corresponding enterNestedEventLoop. This may be null.

Exceptions
IllegalArgumentException:
if the specified key is not associated with an active nested event loop
NullPointerException:
if the key is null
IllegalStateException:
if this method is called on a thread other than the FX Application thread
Since
9
getPreferencesback to summary
public static Platform.Preferences getPreferences()

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 UnsupportedOperationException to be thrown. However, the mappings will be updated by JavaFX when the operating system reports that a platform preference has changed.

Returns:Platform.Preferences

the Preferences instance

Since
22
See Also
Windows preferences, macOS preferences, Linux preferences
isAccessibilityActiveback to summary
public static boolean isAccessibilityActive()
isFxApplicationThreadback 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.

Returns:boolean

true if running on the JavaFX Application Thread

isImplicitExitback to summary
public static boolean isImplicitExit()

Gets the value of the implicitExit attribute.

This method may be called from any thread.

Returns:boolean

the implicitExit attribute

Since
JavaFX 2.2
isKeyLockedback to summary
public static Optional<Boolean> isKeyLocked(KeyCode keyCode)

Returns a flag indicating whether the key corresponding to keyCode is in the locked (or "on") state. keyCode must be one of: KeyCode#CAPS or KeyCode#NUM_LOCK. If the underlying system is not able to determine the state of the specified keyCode, an empty Optional is returned. If the keyboard attached to the system doesn't have the specified key, an Optional containing false is returned. This method must be called on the JavaFX Application thread.

Parameters
keyCode:KeyCode

the KeyCode of the lock state to query

Returns:Optional<Boolean>

the lock state of the key corresponding to keyCode, or an empty Optional if the system cannot determine its state

Exceptions
IllegalArgumentException:
if keyCode is not one of the valid KeyCode values
IllegalStateException:
if this method is called on a thread other than the JavaFX Application Thread
Since
17
isNestedLoopRunningback 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.

Returns:boolean

true if there is a nested event loop running, and false otherwise.

Exceptions
IllegalStateException:
if this method is called on a thread other than the JavaFX Application Thread.
Since
9
isSupportedback 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
}
Parameters
feature:ConditionalFeature

the conditional feature in question.

Returns:boolean

true if a specific conditional feature is supported by the platform, otherwise false

requestNextPulseback 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.

Since
9
runLaterback 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 Application, and use either the Java launcher or one of the launch methods in the Application class to launch the application, the FX runtime is initialized by the launcher before the Application class is loaded. For Swing applications that use JFXPanel to display FX content, the FX runtime is initialized when the first JFXPanel instance is constructed. For SWT application that use FXCanvas to display FX content, the FX runtime is initialized when the first FXCanvas instance is constructed. For applications that do not follow any of these approaches, then it is necessary to manually start the JavaFX runtime by calling startup(Runnable) once.

Memory consistency effects: Actions in a thread prior to submitting a runnable to this method happen-before actions performed by the runnable in the JavaFX Application Thread.

Parameters
runnable:Runnable

the Runnable whose run method will be executed on the JavaFX Application Thread

Exceptions
IllegalStateException:
if the FX runtime has not been initialized
See Also
Application
setImplicitExitback 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 Application#stop method and terminate the JavaFX application thread. If this attribute is false, the application will continue to run normally even after the last window is closed, until the application calls exit. The default value is true.

This method may be called from any thread.

Parameters
implicitExit:boolean

a flag indicating whether or not to implicitly exit when the last window is closed.

Since
JavaFX 2.2
startupback 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 runLater(Runnable) with additional Runnables. Those Runnables will be called, also on the JavaFX Application Thread, after the Runnable passed into this method has been called.

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:

  • For standard JavaFX applications that extend Application, and use either the Java launcher or one of the launch methods in the Application class to launch the application, the FX runtime is initialized automatically by the launcher before the Application class is loaded.
  • For Swing applications that use javafx.embed.swing.JFXPanel to display FX content, the FX runtime is initialized when the first JFXPanel instance is constructed.
  • For SWT application that use FXCanvas to display FX content, the FX runtime is initialized when the first FXCanvas instance is constructed.

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 IllegalStateException being thrown - it is only valid to request that the JavaFX runtime be started once.

Note

The JavaFX classes must be loaded from a set of named javafx.* modules on the module path. Loading the JavaFX classes from the classpath is not supported. A warning is logged when the JavaFX runtime is started if the JavaFX classes are not loaded from the expected named module. This warning is logged regardless of whether the JavaFX runtime was started by calling this method or automatically as described above.

Parameters
runnable:Runnable

the Runnable whose run method will be executed on the JavaFX Application Thread once it has been started

Exceptions
IllegalStateException:
if the JavaFX runtime is already running
Since
9
See Also
Application
javafx.application back to summary

public sealed Interface Platform.Preferences

extends ObservableMap<String, Object>
Known Direct Implementers
com.sun.javafx.application.preferences.PlatformPreferences

Contains preferences of the current platform.

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
Windows.SPI.HighContrastBoolean
Windows.SPI.HighContrastColorSchemeString
Windows.SPI.ClientAreaAnimationBoolean
Windows.SysColor.COLOR_3DFACEColor
Windows.SysColor.COLOR_BTNTEXTColor
Windows.SysColor.COLOR_GRAYTEXTColor
Windows.SysColor.COLOR_HIGHLIGHTColor
Windows.SysColor.COLOR_HIGHLIGHTTEXTColor
Windows.SysColor.COLOR_HOTLIGHTColor
Windows.SysColor.COLOR_WINDOWColor
Windows.SysColor.COLOR_WINDOWTEXTColor
Windows.UIColor.BackgroundColor
Windows.UIColor.ForegroundColor
Windows.UIColor.AccentDark3Color
Windows.UIColor.AccentDark2Color
Windows.UIColor.AccentDark1Color
Windows.UIColor.AccentColor
Windows.UIColor.AccentLight1Color
Windows.UIColor.AccentLight2Color
Windows.UIColor.AccentLight3Color
Windows.UISettings.AdvancedEffectsEnabledBoolean
Windows.UISettings.AutoHideScrollBarsBoolean
Windows.NetworkInformation.InternetCostTypeString
macOS
macOS.NSColor.labelColorColor
macOS.NSColor.secondaryLabelColorColor
macOS.NSColor.tertiaryLabelColorColor
macOS.NSColor.quaternaryLabelColorColor
macOS.NSColor.textColorColor
macOS.NSColor.placeholderTextColorColor
macOS.NSColor.selectedTextColorColor
macOS.NSColor.textBackgroundColorColor
macOS.NSColor.selectedTextBackgroundColorColor
macOS.NSColor.keyboardFocusIndicatorColorColor
macOS.NSColor.unemphasizedSelectedTextColorColor
macOS.NSColor.unemphasizedSelectedTextBackgroundColorColor
macOS.NSColor.linkColorColor
macOS.NSColor.separatorColorColor
macOS.NSColor.selectedContentBackgroundColorColor
macOS.NSColor.unemphasizedSelectedContentBackgroundColorColor
macOS.NSColor.selectedMenuItemTextColorColor
macOS.NSColor.gridColorColor
macOS.NSColor.headerTextColorColor
macOS.NSColor.alternatingContentBackgroundColorsColor[]
macOS.NSColor.controlAccentColorColor
macOS.NSColor.controlColorColor
macOS.NSColor.controlBackgroundColorColor
macOS.NSColor.controlTextColorColor
macOS.NSColor.disabledControlTextColorColor
macOS.NSColor.selectedControlColorColor
macOS.NSColor.selectedControlTextColorColor
macOS.NSColor.alternateSelectedControlTextColorColor
macOS.NSColor.currentControlTintString
macOS.NSColor.windowBackgroundColorColor
macOS.NSColor.windowFrameTextColorColor
macOS.NSColor.underPageBackgroundColorColor
macOS.NSColor.findHighlightColorColor
macOS.NSColor.highlightColorColor
macOS.NSColor.shadowColorColor
macOS.NSColor.systemBlueColorColor
macOS.NSColor.systemBrownColorColor
macOS.NSColor.systemGrayColorColor
macOS.NSColor.systemGreenColorColor
macOS.NSColor.systemIndigoColorColor
macOS.NSColor.systemOrangeColorColor
macOS.NSColor.systemPinkColorColor
macOS.NSColor.systemPurpleColorColor
macOS.NSColor.systemRedColorColor
macOS.NSColor.systemTealColorColor
macOS.NSColor.systemYellowColorColor
macOS.NSWorkspace.accessibilityDisplayShouldReduceMotionBoolean
macOS.NSWorkspace.accessibilityDisplayShouldReduceTransparencyBoolean
macOS.NSScroller.preferredScrollerStyleString
macOS.NWPathMonitor.currentPathConstrainedBoolean
macOS.NWPathMonitor.currentPathExpensiveBoolean
Linux
GTK.theme_nameString
GTK.theme_fg_colorColor
GTK.theme_bg_colorColor
GTK.theme_base_colorColor
GTK.theme_selected_bg_colorColor
GTK.theme_selected_fg_colorColor
GTK.theme_unfocused_fg_colorColor
GTK.theme_unfocused_bg_colorColor
GTK.theme_unfocused_base_colorColor
GTK.theme_unfocused_selected_bg_colorColor
GTK.theme_unfocused_selected_fg_colorColor
GTK.insensitive_bg_colorColor
GTK.insensitive_fg_colorColor
GTK.insensitive_base_colorColor
GTK.bordersColor
GTK.unfocused_bordersColor
GTK.warning_colorColor
GTK.error_colorColor
GTK.success_colorColor
GTK.enable_animationsBoolean
GTK.overlay_scrollingBoolean
GTK.network_meteredBoolean
Since
22

Method Summary

Modifier and TypeMethod and Description
public ReadOnlyObjectProperty<Color>

Returns:

the accentColor property
accentColorProperty
()

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.

public ReadOnlyObjectProperty<Color>

Returns:

the backgroundColor property
backgroundColorProperty
()

The color used for background regions.

public ReadOnlyObjectProperty<ColorScheme>

Returns:

the colorScheme property
colorSchemeProperty
()

The platform color scheme, which specifies whether applications should prefer light text on dark backgrounds, or dark text on light backgrounds.

public ReadOnlyObjectProperty<Color>

Returns:

the foregroundColor property
foregroundColorProperty
()

The color used for foreground elements like text.

public Color
public Color
public Optional<Boolean>

Returns:

the optional Boolean to which the key is mapped
getBoolean
(String
the key
key
)

Returns an optional Boolean to which the specified key is mapped.

public Optional<Color>

Returns:

the optional Color instance to which the key is mapped
getColor
(String
the key
key
)

Returns an optional Color to which the specified key is mapped.

public ColorScheme
public Optional<Double>

Returns:

the optional Double to which the key is mapped
getDouble
(String
the key
key
)

Returns an optional Double to which the specified key is mapped.

public Color
public Optional<Integer>

Returns:

the optional Integer to which the key is mapped
getInteger
(String
the key
key
)

Returns an optional Integer to which the specified key is mapped.

public Optional<String>

Returns:

the optional String to which the key is mapped
getString
(String
the key
key
)

Returns an optional String to which the specified key is mapped.

public <
the type of the value
T
>
Optional<T>

Returns:

the optional value to which the key is mapped
getValue
(String
the key
key
,
Class<T>
the type of the value
type
)

Returns an optional value to which the specified key is mapped.

public boolean
public boolean
public boolean
public boolean
public ReadOnlyBooleanProperty

Returns:

the persistentScrollBars property
persistentScrollBarsProperty
()

Specifies whether applications should always show scroll bars.

public ReadOnlyBooleanProperty

Returns:

the reducedData property
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.

public ReadOnlyBooleanProperty

Returns:

the reducedMotion property
reducedMotionProperty
()

Specifies whether applications should minimize the amount of non-essential animations, reducing discomfort for users who experience motion sickness or vertigo.

public ReadOnlyBooleanProperty

Returns:

the reducedTransparency property
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.

Inherited from javafx.collections.ObservableMap:
addListenerremoveListener

Method Detail

accentColorPropertyback to summary
public ReadOnlyObjectProperty<Color> accentColorProperty()

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.

If the platform does not report an accent color, this property defaults to vivid blue (corresponding to the hex color value #157EFB).

Returns:ReadOnlyObjectProperty<Color>

the accentColor property

Default Value
#157EFB
backgroundColorPropertyback to summary
public ReadOnlyObjectProperty<Color> backgroundColorProperty()

The color used for background regions.

If the platform does not report a background color, this property defaults to WHITE.

Returns:ReadOnlyObjectProperty<Color>

the backgroundColor property

Default Value
Color#WHITE
colorSchemePropertyback to summary
public ReadOnlyObjectProperty<ColorScheme> colorSchemeProperty()

The platform color scheme, which specifies whether applications should prefer light text on dark backgrounds, or dark text on light backgrounds.

If the platform does not report color preferences, this property defaults to LIGHT.

Returns:ReadOnlyObjectProperty<ColorScheme>

the colorScheme property

Default Value
ColorScheme#LIGHT
foregroundColorPropertyback to summary
public ReadOnlyObjectProperty<Color> foregroundColorProperty()

The color used for foreground elements like text.

If the platform does not report a foreground color, this property defaults to BLACK.

Returns:ReadOnlyObjectProperty<Color>

the foregroundColor property

Default Value
Color#BLACK
getAccentColorback to summary
public Color getAccentColor()
getBackgroundColorback to summary
public Color getBackgroundColor()
getBooleanback to summary
public Optional<Boolean> getBoolean(String key)

Returns an optional Boolean to which the specified key is mapped.

Parameters
key:String

the key

Returns:Optional<Boolean>

the optional Boolean to which the key is mapped

Exceptions
NullPointerException:
if key is null
IllegalArgumentException:
if the key is not mappable to a Boolean
getColorback to summary
public Optional<Color> getColor(String key)

Returns an optional Color to which the specified key is mapped.

Parameters
key:String

the key

Returns:Optional<Color>

the optional Color instance to which the key is mapped

Exceptions
NullPointerException:
if key is null
IllegalArgumentException:
if the key is not mappable to a Color
getColorSchemeback to summary
public ColorScheme getColorScheme()
getDoubleback to summary
public Optional<Double> getDouble(String key)

Returns an optional Double to which the specified key is mapped.

Parameters
key:String

the key

Returns:Optional<Double>

the optional Double to which the key is mapped

Exceptions
NullPointerException:
if key is null
IllegalArgumentException:
if the key is not mappable to a Double
getForegroundColorback to summary
public Color getForegroundColor()
getIntegerback to summary
public Optional<Integer> getInteger(String key)

Returns an optional Integer to which the specified key is mapped.

Parameters
key:String

the key

Returns:Optional<Integer>

the optional Integer to which the key is mapped

Exceptions
NullPointerException:
if key is null
IllegalArgumentException:
if the key is not mappable to an Integer
getStringback to summary
public Optional<String> getString(String key)

Returns an optional String to which the specified key is mapped.

Parameters
key:String

the key

Returns:Optional<String>

the optional String to which the key is mapped

Exceptions
NullPointerException:
if key is null
IllegalArgumentException:
if the key is not mappable to a String
getValueback to summary
public <T> Optional<T> getValue(String key, Class<T> type)

Returns an optional value to which the specified key is mapped.

Parameters
<T>
the type of the value
key:String

the key

type:Class<T>

the type of the value

Returns:Optional<T>

the optional value to which the key is mapped

Exceptions
NullPointerException:
if key or type is null
IllegalArgumentException:
if the key is not mappable to a value of type T
isPersistentScrollBarsback to summary
public boolean isPersistentScrollBars()
isReducedDataback to summary
public boolean isReducedData()
isReducedMotionback to summary
public boolean isReducedMotion()
isReducedTransparencyback to summary
public boolean isReducedTransparency()
persistentScrollBarsPropertyback 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.

If the platform does not report this preference, this property defaults to false.

Returns:ReadOnlyBooleanProperty

the persistentScrollBars property

Default Value
false
Since
24
reducedDataPropertyback 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.

If the platform does not report this preference, this property defaults to false.

Returns:ReadOnlyBooleanProperty

the reducedData property

Default Value
false
Since
24
reducedMotionPropertyback 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.

If the platform does not report this preference, this property defaults to false.

Returns:ReadOnlyBooleanProperty

the reducedMotion property

Default Value
false
Since
24
reducedTransparencyPropertyback 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.

If the platform does not report this preference, this property defaults to false.

Returns:ReadOnlyBooleanProperty

the reducedTransparency property

Default Value
false
Since
24