If i try to update the items of a choicebox over his observablelist all items of the observablelist is showing twice in the choicebox. i've looking in debug mode and in the observablelist everything is fine.
Code to reproduce it:
private ObservableList<String> excercise = FXCollections.observableArrayList();
private ChoiceBox<String> excerciseBox = new ChoiceBox<>(excercise);
private String[] exerciseKeySet;
then in the construktor
excercise.addAll(Arrays.asList(exerciseKeySet));
until her everything works well
but after a update to the data in exercisekeyset i try to reload the data with:
excercise.setAll(Arrays.asList(exerciseKeySet));
The lenght of the Array at the moment of the update are 3 and in the choicebox are showing 6 items
And now all items are showing twice (see also screenshot attached
Code to reproduce it:
private ObservableList<String> excercise = FXCollections.observableArrayList();
private ChoiceBox<String> excerciseBox = new ChoiceBox<>(excercise);
private String[] exerciseKeySet;
then in the construktor
excercise.addAll(Arrays.asList(exerciseKeySet));
until her everything works well
but after a update to the data in exercisekeyset i try to reload the data with:
excercise.setAll(Arrays.asList(exerciseKeySet));
The lenght of the Array at the moment of the update are 3 and in the choicebox are showing 6 items
And now all items are showing twice (see also screenshot attached