I have created a table view in javafx for my custom object. I have enabled multiple selection in the code by doing:
table.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
Randomly I observe that when I select all the items by pressing Ctrl+A, one of the items is returned as null among all the selected items. Not sure why this happens. I use below line to fetch all items:
ObservableList<MyObj> selectedItems = table.getSelectionModel().getSelectedItems();
Any suggestions?
index -1
? – Hypsography