I would like to implement a scrollable ListView with gestures, just like in mobiles and tablets, to scroll up and down my list with a finger. But my current list selects an item as soon as I click down on the list. How can I achieve this? I couldn't find any example at the Oracle tutorials.
private ObservableList<Document> items = FXCollections.observableArrayList();
@FXML ListView<Document> listView;
{
...
listView.setItems(items);
listView.getStylesheets().add("style/listview.css");
listView.setStyle("-fx-background-insets: 0 ;"); // remove 1px border of listview container
listView.setCellFactory(new Callback<ListView<Document>, ListCell<Document>>() {
@Override
public ListCell<Document> call(ListView<Document> listView) {
return new DocumentArrayAdapter();
}
});
...
}
public void loadListView(List<Document> ldoc){
if (!ldoc.isEmpty()){
items.addAll(ldoc);
}
}