Im trying to update the primaryStage after a set amount of time. This gives me: java.lang.IllegalStateException: Not on FX application thread;
I've been searching for a solution on StackOverflow and I found some people suggest using
Platform.runLater(new Runnable ...)
Source: https://stackoverflow.com/a/17851019/5314214
But still I can't figure out how to make it work after a set amount of time.
My code:
Timer timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
update(primaryStage);
timer.cancel();
}
}, 400);