changeset 5935:c7d6f188d1d3

RT-19968: Document that Platform.runLater must not be called before FX is initialized
author kcr
date Mon, 09 Dec 2013 15:17:45 -0800
parents 57153bcef81f
children ac015a4a85b7
files modules/graphics/src/main/java/javafx/application/Platform.java
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/javafx/application/Platform.java	Mon Dec 09 15:15:59 2013 -0800
+++ b/modules/graphics/src/main/java/javafx/application/Platform.java	Mon Dec 09 15:17:45 2013 -0800
@@ -46,8 +46,23 @@
      * A runnable passed into the runLater method will be
      * executed before any Runnable passed into a subsequent call to runLater.
      *
+     * <p>
+     * This method must not be called before the FX runtime has been
+     * initialized. For standard JavaFX applications that extend
+     * {@see 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.
+     * </p>
+     *
      * @param runnable the Runnable whose run method will be executed on the
      * JavaFX Application Thread
+     *
+     * @throws IllegalStateException if the FX runtime has not been initialized
      */
     public static void runLater(Runnable runnable) {
         PlatformImpl.runLater(runnable);