How can I make the background of a content ScrollPane
show what's underneath? With setOpacity()
the controls contained in it also become translucent ScrollPane
and what I intend is that it only be the semi-transparent background. I have tried with CSS: - fx-background-color: rgba(100,100,100, 0.5);
but the background is still opaque.
The common mistake is trying to apply the opacity directly to the
ScrollPane
, and not to yourviewport
. The solution in CSS is:And in java code:
First you need to add that:
And now you can make the
ScrollPane
transparent with this:I hope I have helped.
References: