Run attached code:
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.ListView;
import javafx.scene.control.SelectionMode;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public void start(Stage stage) {
ListView LV = new ListView();
LV.setPrefHeight(100);
LV.setPrefWidth(50);
LV.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
for (int i = 0; i < 20; i++) {
LV.getItems().add(i, i);
}
Group root = new Group();
root.getChildren().addAll(LV);
stage.setScene(new Scene(root, 300, 300));
stage.show();
}
public static void main(String[] args) {
launch(Main.class, args);
}
}
1) Select the first item
2) press shift+pageDown 2 times.
3) preff shift+pageUp 1 time.
See, selection is the first item only, but I expect 4-5 items to be selected.
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.ListView;
import javafx.scene.control.SelectionMode;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public void start(Stage stage) {
ListView LV = new ListView();
LV.setPrefHeight(100);
LV.setPrefWidth(50);
LV.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
for (int i = 0; i < 20; i++) {
LV.getItems().add(i, i);
}
Group root = new Group();
root.getChildren().addAll(LV);
stage.setScene(new Scene(root, 300, 300));
stage.show();
}
public static void main(String[] args) {
launch(Main.class, args);
}
}
1) Select the first item
2) press shift+pageDown 2 times.
3) preff shift+pageUp 1 time.
See, selection is the first item only, but I expect 4-5 items to be selected.
- relates to
-
JDK-8089636 Keyboard navigation in ListView/TreeView/TableView/TreeTableView
- Open