Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8096821

[ListView] Multiple selection works inconsistently.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Cannot Reproduce
    • Affects Version/s: 8
    • Fix Version/s: 8u60
    • Component/s: javafx
    • Labels:
    • Environment:

      jdk1.8.0_b66 Mac OS X 10.7.4

      Description

      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);
          }
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jgiles Jonathan Giles
              Reporter:
              dzinkevi Dmitry Zinkevich (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported: