I tried this on Windows keyboard because it has 'Home' button (using Win key instead of Cmd)
To reproduce click at any item in the middle of control
and then push Cmd+Home.
You will see that the focused item remains the same.
public void start(Stage primaryStage) {
TreeItem root = new TreeItem("Root");
TreeView treeView = new TreeView(root);
treeView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
for (int i = 0; i < 15; i++) {
root.getChildren().add(new TreeItem("item - " + i));
}
HBox container = new HBox();
container.setMaxSize(100, 150);
container.getChildren().add(treeView);
Scene scene = new Scene(container, 300, 250);
primaryStage.setTitle(VersionInfo.getRuntimeVersion());
primaryStage.setScene(scene);
primaryStage.show();
}
To reproduce click at any item in the middle of control
and then push Cmd+Home.
You will see that the focused item remains the same.
public void start(Stage primaryStage) {
TreeItem root = new TreeItem("Root");
TreeView treeView = new TreeView(root);
treeView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
for (int i = 0; i < 15; i++) {
root.getChildren().add(new TreeItem("item - " + i));
}
HBox container = new HBox();
container.setMaxSize(100, 150);
container.getChildren().add(treeView);
Scene scene = new Scene(container, 300, 250);
primaryStage.setTitle(VersionInfo.getRuntimeVersion());
primaryStage.setScene(scene);
primaryStage.show();
}
- relates to
-
JDK-8089636 Keyboard navigation in ListView/TreeView/TableView/TreeTableView
- Open