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

ScrollBar doensn't receive onScroll event

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not an Issue
    • P4
    • 9
    • 8
    • javafx
    • b116

    Description

      To reproduce place mouse over the scroll bar and turn the wheel. Expect receiving onScroll.

      import javafx.application.Application;
      import javafx.event.EventHandler;
      import javafx.scene.Scene;
      import javafx.scene.control.ComboBox;
      import javafx.scene.control.ScrollBar;
      import javafx.scene.input.ScrollEvent;
      import javafx.scene.layout.HBox;
      import javafx.stage.Stage;

      public class App extends Application {

          public static void main(String[] args) {
              launch(args);
          }
          
          @Override
          public void start(Stage stage) throws Exception {
              HBox root = new HBox(4);

              root.getChildren().add(new ComboBox());

              ScrollBar scrollBar = new ScrollBar();
              scrollBar.setOnScroll(new EventHandler<ScrollEvent>() {
                  @Override
                  public void handle(ScrollEvent scrollEvent) {
                      System.err.println("On Scroll");
                  }
              });

              root.getChildren().add(scrollBar);

              Scene scene = new Scene(root, 404, 300);
              stage.setScene(scene);
              stage.show();
          }

      }

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:
              Imported: