// How NOT to do this
private void removeSelectedListItemsBAD(ListView list) {
list.getItems().removeAll(list.getSelectionModel().getSelectedItems());
list.getSelectionModel().clearSelection();
}
Can you spot the flaw?
Hint... Try it on a list, but only select the first item.
Related issue: RT-24371
Scott