I cannot set the background color of a ScrollPane in the latest version of JavaFX 8 (java 8 b-110 and above versions). So I need to know whether this is a permanent issue or temporarily (which can be Fixed in later versions)?
The simplest way to set the JavaFX Scene background color or image is by invoking the Scene 's setFill() method, which can accept a color, gradient or image pattern. A more flexible way to set the background of a scene is to set the root node's background, which can accept multiple images and fills.
The ScrollPane allows the application to set the current, minimum, and maximum values for positioning the contents in the horizontal and vertical directions. These values are mapped proportionally onto the layoutBounds of the contained node.
Set an id to your AnchorPane in the fxml and then in your css assign the id to -fx-background-color : transparent.
I ended up using -fx-background:green;
instead of -fx-background-color:green;
because -fx-background-color
only set the colour for the borders of ScrollPane
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With