I am developing a javafx application which has a ListView supported by an ObservableList.
@FXML
private ListView<String> taggedQueriesResultsList;
private ObservableList<String> searchResultsList = FXCollections.observableArrayList();
The ObservableList is updated with data, say list.add("something")
, by a scheduled task using Executors.newSingleThreadScheduledExecutor()
. However the scheduled task never runs after the first time. The UI is updated after the first run. I have noticed that if I comment out the line list.add("something")
the task runs periodically as scheduled.
I think this is some synchronisation issue but not sure. Please help me understand what is going on and how to resolve the issue.