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

Mouse wheel scrolling support requested for ListView

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • fx2.0
    • fx2.0
    • javafx

      ListView does not support wheel scrolling.

      In my view, this is required to be competitive. Most frameworks including Swing support this.

      To replicate, issue the following code and try to use the scroll wheel of the mouse.


      package test;

      import javafx.application.Application;
      import javafx.application.Launcher;
      import javafx.collections.FXCollections;
      import javafx.scene.Scene;
      import javafx.scene.layout.BorderPane;
      import javafx.scene.layout.Pane;
      import javafx.stage.Stage;
      import javafx.stage.StageStyle;

      /**
       * Illustrates that the scroll wheel of the mouse does not work by displaying a ListView.
       */
      public class ListViewTest extends Application {

          @Override

          public void start() {
              BorderPane root = new BorderPane();
              root.setId("root");
              Stage stage = new Stage(StageStyle.DECORATED);
              Scene scene = new Scene(root, 1000, 700);

              root.setCenter(new ListView());

              stage.setScene(scene);
              stage.setVisible(true);
          }


          public static void main(String[] args) {
              System.setProperty("http.proxyHost", "www-proxy.us.oracle.com");
              System.setProperty("http.proxyPort", "80");
              Launcher.launch(ListViewTest.class, args);
          }

          public class ListView extends Pane {

              public ListView() {
                  final javafx.scene.control.ListView listView = new javafx.scene.control.ListView();
                  listView.setItems(FXCollections.sequence(
                          "Row 1", "Row 2", "Long Row 3", "Row 4", "Row 5", "Row 6",
                          "Row 7", "Row 8", "Row 9", "Row 10", "Row 11", "Row 12", "Row 13",
                          "Row 14", "Row 15", "Row 16", "Row 17", "Row 18", "Row 19", "Row 20"
                  ));
                  listView.getSelectionModel().setMultipleSelectionEnabled(true);
                  getChildren().add(listView);


              }


          }

      }

            jgiles Jonathan Giles
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: