public static void runInFX(Runnable doRun){
  if (Platform.isFxApplicationThread()) {
    doRun.run();
    return;
  }
  Platform.runLater(doRun);
}

public static void runInFX ( Runnable doRun ) { if ( Platform . isFxApplicationThread ( ) ) { doRun . run ( ) ; return ; } Platform . runLater ( doRun ) ; }
this method is used to run a specified runnable in the fx application thread , it returns before the task finished execution
