invoke On JavaFX Application Thread - Java JavaFX

Java examples for JavaFX:JavaFX Thread

Description

invoke On JavaFX Application Thread

Demo Code


//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);
        }
    }
}

Related Tutorials