On Tue, 21 Feb 2023 00:29:13 GMT, Thiago Milczarek Sayao <tsa...@openjdk.org> 
wrote:

>> Simple PR to remove gtk2 library compilation and loading.
>
> Thiago Milczarek Sayao has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Improve exception

import com.jfoenix.controls.JFXScrollPane;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
import javafx.stage.Stage;

import java.util.stream.IntStream;

public class Main extends Application {

    @Override
    public void start(Stage primaryStage) throws Exception {
        ScrollPane scrollPane = new ScrollPane();
        scrollPane.setContent(new Label(String.join("\n", IntStream.range(0, 
1000).mapToObj(it -> "line" + it).toList())));
        JFXScrollPane.smoothScrolling(scrollPane);

        Scene scene = new Scene(scrollPane, 300, 400);
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    public static void main(String[] args) {
        Application.launch(Main.class);
    }
}


This is an example. You can place JFoenix 
(https://repo1.maven.org/maven2/com/jfoenix/jfoenix/9.0.10/jfoenix-9.0.10.jar) 
on classpath to run it.

When using GTK 2, it works well. However, when using GTK3, the scroll wheel can 
only scroll down, not up.

Tested on Ubuntu 20.04/22.04, this phenomenon occurred on multiple x86 and arm 
machines.

-------------

PR: https://git.openjdk.org/jfx/pull/999

Reply via email to