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