Execute task in background in JavaFX
JavaFX has Event Dispatch Thread which it uses for UI events. All work with UI should happen on this thread. And non-UI calculations shouldn’t happen there to avoid lags in UI. See next code: public class Indicators extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) { Pane … Read more