diff --git a/visualiser/src/main/java/seng302/Controllers/RaceController.java b/visualiser/src/main/java/seng302/Controllers/RaceController.java index 106a0089..5781f9e7 100644 --- a/visualiser/src/main/java/seng302/Controllers/RaceController.java +++ b/visualiser/src/main/java/seng302/Controllers/RaceController.java @@ -1,6 +1,7 @@ package seng302.Controllers; +import javafx.application.Platform; import javafx.collections.ObservableList; import javafx.fxml.FXML; import javafx.scene.control.*; @@ -118,7 +119,14 @@ public class RaceController extends Controller { //Initialize save annotation array, fps listener, and annotation listeners timeZone.setText(raceClock.getTimeZone()); - timer.textProperty().bind(raceClock.durationProperty()); + + //RaceClock.duration isn't necessarily being changed in the javaFX thread, so we need to runlater the update. + raceClock.durationProperty().addListener((observable, oldValue, newValue) -> { + Platform.runLater(() -> { + timer.setText(newValue); + }); + }); + initializeFPS(); initializeAnnotations();