Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug - extra space between ListView items #111

Open
PavelTurk opened this issue Sep 13, 2024 · 1 comment
Open

Bug - extra space between ListView items #111

PavelTurk opened this issue Sep 13, 2024 · 1 comment

Comments

@PavelTurk
Copy link

This is the code:

public class JavaFxTest10 extends Application {

    @Override
    public void start(Stage primaryStage) {
        Application.setUserAgentStylesheet(new Dracula().getUserAgentStylesheet());
        ObservableList<String> items = FXCollections.observableArrayList(
            "Foo 1",
            "Foo 2",
            "Foo 3",
            "Foo 4",
            "Foo 5",
            "Foo 6"
        );

        ListView<String> listView = new ListView<>(items);
        var root = new VBox(listView);
        root.setStyle("-fx-background-color: red");
        Scene scene = new Scene(root, 400, 300);
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}

And this is the result:
Screenshot from 2024-09-13 14-02-37

As you see there is an extra space between items.

@bitfist
Copy link

bitfist commented Dec 15, 2024

I'm encountering the same issue. What I noticed is that the number of extra spaces in the list depends on the font size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants