Skip to content

Instantly share code, notes, and snippets.

@Aero-Blue
Created March 11, 2020 01:57
Show Gist options
  • Save Aero-Blue/9e3feeff921afac6d011cce443367058 to your computer and use it in GitHub Desktop.
Save Aero-Blue/9e3feeff921afac6d011cce443367058 to your computer and use it in GitHub Desktop.
Update UI with background operation (JavaFX, 8)
Thread thread = new Thread(() -> {
Runnable updater = () -> {
// update ui operation / last here
};
// perform background operations here
Platform.runLater(updater);
});
thread.setDaemon(true); // let application close
thread.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment