Question

I have a image which I would like to edit with JavaFX. How I could add almost transparent rectangle and text similar to the image below?

enter image description here

Was it helpful?

Solution

Use a VBox to wrap a Label or two and wrap that in a Pane or some other basic node. Style the label to get the desired text appearance, and style the highest node (the one wrapping your VBox) to have a semi-transparent background like so: -fx-background-color: #000000a8;. Change the last two characters ("a8") to achieve the desired level of transparency.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top