private void initPaintThread() { ScheduledService<Boolean> svc = new ScheduledService<Boolean>() { protected Task<Boolean> createTask() { return new Task<Boolean>() { protected Boolean call() { Platform.runLater(() -> { drawMap(gc); }); return true; } }; } }; svc.setPeriod(Duration.millis(1000.0 / PAINT_HZ)); svc.start(); }