To reproduce:
1. Click on the first label;
2. Push Meta+A;
3. Push Meta+Down arrow;
4. Push Shift+Down arrow;
It is expected that nothing will change and that all items will remain selected, but actually only the last item will be selected.
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.ListView;
import javafx.scene.control.SelectionMode;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class JavaFXApplication16 extends Application {
@Override
public void start(Stage primaryStage) {
ListView lv = new ListView();
for (int i = 0; i < 10; i++) {
lv.getItems().add(new Label("Label-" + i));
}
lv.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
StackPane root = new StackPane();
root.getChildren().add(lv);
Scene scene = new Scene(root, 300, 250);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
1. Click on the first label;
2. Push Meta+A;
3. Push Meta+Down arrow;
4. Push Shift+Down arrow;
It is expected that nothing will change and that all items will remain selected, but actually only the last item will be selected.
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.ListView;
import javafx.scene.control.SelectionMode;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class JavaFXApplication16 extends Application {
@Override
public void start(Stage primaryStage) {
ListView lv = new ListView();
for (int i = 0; i < 10; i++) {
lv.getItems().add(new Label("Label-" + i));
}
lv.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
StackPane root = new StackPane();
root.getChildren().add(lv);
Scene scene = new Scene(root, 300, 250);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
- relates to
-
JDK-8089636 Keyboard navigation in ListView/TreeView/TableView/TreeTableView
- Open