public final class Platform extends Object
Type | Property and Description |
---|---|
static ReadOnlyBooleanProperty |
accessibilityActive
Indicates whether or not accessibility is active.
|
Modifier and Type | Method and Description |
---|---|
static ReadOnlyBooleanProperty |
accessibilityActiveProperty()
Indicates whether or not accessibility is active.
|
static void |
exit()
Causes the JavaFX application to terminate.
|
static boolean |
isAccessibilityActive()
Gets the value of the property accessibilityActive.
|
static boolean |
isFxApplicationThread()
Returns true if the calling thread is the JavaFX Application Thread.
|
static boolean |
isImplicitExit()
Gets the value of the implicitExit attribute.
|
static boolean |
isSupported(ConditionalFeature feature)
Queries whether a specific conditional feature is supported
by the platform.
|
static void |
runLater(Runnable runnable)
Run the specified Runnable on the JavaFX Application Thread at some
unspecified
time in the future.
|
static void |
setImplicitExit(boolean implicitExit)
Sets the implicitExit attribute to the specified value.
|
public static ReadOnlyBooleanProperty accessibilityActiveProperty
This method may be called from any thread.
isAccessibilityActive()
public static void runLater(Runnable runnable)
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.
runnable
- the Runnable whose run method will be executed on the
JavaFX Application ThreadIllegalStateException
- if the FX runtime has not been initializedpublic static boolean isFxApplicationThread()
public static void exit()
This method may be called from any thread.
Note: if the application is embedded in a browser, then this method may have no effect.
public static void setImplicitExit(boolean implicitExit)
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.
implicitExit
- a flag indicating whether or not to implicitly exit
when the last window is closed.public static boolean isImplicitExit()
This method may be called from any thread.
public static boolean isSupported(ConditionalFeature feature)
For example:
// Query whether filter effects are supported if (Platform.isSupported(ConditionalFeature.EFFECT)) { // use effects }
feature
- the conditional feature in question.public static boolean isAccessibilityActive()
This method may be called from any thread.
public static ReadOnlyBooleanProperty accessibilityActiveProperty()
This method may be called from any thread.
isAccessibilityActive()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2017, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.