-
Bug
-
Resolution: Fixed
-
P4
-
8
-
b101
To reproduce:
1. Select 3 items using SHIFT + Left Mouse Button; Three items will be selected.
2. Then make SHIFT + Left Mouse cilck on the first item
Expected: Only the first item is selected
Result: First and third items are selected
import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.Scene;
import javafx.scene.control.ListView;
import javafx.scene.control.SelectionMode;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class ListViewSelection extends Application {
public static final ObservableList names =
FXCollections.observableArrayList();
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("List View Sample");
final ListView listView = new ListView(names);
listView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
listView.setPrefSize(200, 250);
names.addAll(
"Adam", "Alex", "Alfred", "Albert",
"Brenda", "Connie", "Derek", "Donny",
"Lynne", "Myrtle", "Rose", "Rudolph",
"Tony", "Trudy", "Williams", "Zach"
);
StackPane root = new StackPane();
root.getChildren().add(listView);
primaryStage.setScene(new Scene(root, 200, 250));
primaryStage.show();
}
}
1. Select 3 items using SHIFT + Left Mouse Button; Three items will be selected.
2. Then make SHIFT + Left Mouse cilck on the first item
Expected: Only the first item is selected
Result: First and third items are selected
import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.Scene;
import javafx.scene.control.ListView;
import javafx.scene.control.SelectionMode;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class ListViewSelection extends Application {
public static final ObservableList names =
FXCollections.observableArrayList();
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("List View Sample");
final ListView listView = new ListView(names);
listView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
listView.setPrefSize(200, 250);
names.addAll(
"Adam", "Alex", "Alfred", "Albert",
"Brenda", "Connie", "Derek", "Donny",
"Lynne", "Myrtle", "Rose", "Rudolph",
"Tony", "Trudy", "Williams", "Zach"
);
StackPane root = new StackPane();
root.getChildren().add(listView);
primaryStage.setScene(new Scene(root, 200, 250));
primaryStage.show();
}
}