Is there any way to force a ListView refresh in Javafx 2.1 without reloading the list and changing the selected value?
The observable list is made of Strings so changing their value is not feasible.
Is there any way to force a ListView refresh in Javafx 2.1 without reloading the list and changing the selected value?
The observable list is made of Strings so changing their value is not feasible.
Try:
...
ObservableList<String> olist = ...
ListView<String> listv = ...
...
listv.setItems(null);
listv.setItems(olist);
Wrapping the String values with Property like SimpleStringProperty
and changing this property's value should be feasible.
I use:
private static final ObservableList<String> lists = FXCollections.observableArrayList();
...
synchronized(lists) {
List<String> lsts = new ArrayList<>();
lsts.addAll(lists);
lists.clear();
lists.addAll(lsts);
}