changeset 5956:2a14ca6aedf3

RT-21569: Document that applications should avoid flooding FX with Platform.runLater calls Reviewed-by: anthony
author kcr
date Tue, 10 Dec 2013 10:03:00 -0800
parents 3852407693a0
children 6a8c274547fa
files modules/graphics/src/main/java/javafx/application/Platform.java
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/javafx/application/Platform.java	Tue Dec 10 09:44:46 2013 -0800
+++ b/modules/graphics/src/main/java/javafx/application/Platform.java	Tue Dec 10 10:03:00 2013 -0800
@@ -47,6 +47,16 @@
      * executed before any Runnable passed into a subsequent call to runLater.
      *
      * <p>
+     * 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.
+     * </p>
+     *
+     * <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