How to get transparent list view in javafx?
Asked Answered
B

1

7

I have a list view. I want to make the cells background transparent. Currently, I am doing the following:

.list-cell
{
    -fx-background-color: transparent;
}

But, the color of the cells remain white. I have tried the same with other colors. It works for other colors. But, it's not working for the transparent color. How can I get a transparent list-view?

Bakunin answered 1/11, 2015 at 13:37 Comment(5)
Change to opacity on the list view.Alcoholic
But, wouldn't that mess up with the text opacity?Bakunin
Well yes, perhaps it would help if you shared more code to explain for what effect you are aiming.Alcoholic
Even if the list-cell background is transparent, the background color is still white which is what you do not want. But, I can't still be sure if you do not share more code or an image of what you are looking for.Nathalienathan
If you make the list cells transparent, then you will see through them to whatever is behind them: ie. the list view itself. If you make the list view transparent as well, then you will see whatever is behind it.Festoonery
R
10

You have to make both the list-view and list-cell transparent.

.list-cell {
    -fx-background-color: transparent;
}
.list-view {
    -fx-background-color: transparent;
}
Ruby answered 6/7, 2017 at 0:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.