Я хотел бы реализовать прокручиваемый ListView с помощью жестов, как на мобильных телефонах и планшетах, для прокрутки моего списка пальцем вверх и вниз. Но мой текущий список выбирает элемент, как только я нажимаю на него. Как я могу этого добиться? Я не смог найти ни одного примера в учебниках Oracle.
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);
}
}