Java examples for JavaFX:JavaFX Thread
invoke On JavaFX Application Thread
//package com.java2s; import javafx.application.Platform; public class Main { public static void invokeOnApplicationThread(Runnable runnable) { if (Platform.isFxApplicationThread()) { runnable.run();//from www .j ava2 s . c o m } else { Platform.runLater(runnable); } } }