Is there an option in JavaFX to deactivate the possibility to select the items in a ListView via mouse?
I\'d like to just display a ListView
@Override
protected void updateItem(T item, boolean empty) {
super.updateItem(item, empty);
updateSelected(false);
}
Every time you click on a cell, the cell's updateItem will call, so you can deselect it at here. If you check the base class Cell.java. It use this method to prevent empty cell being selected.
protected void updateItem(T item, boolean empty) {
setItem(item);
setEmpty(empty);
if (empty && isSelected()) {
updateSelected(false);
}
}