GowthamIyer
GowthamIyer

Reputation: 485

Set the background color of a ScrollPane in JavaFX 8

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)?

Upvotes: 7

Views: 12097

Answers (3)

GowthamIyer
GowthamIyer

Reputation: 485

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.

Upvotes: 10

Jon Onstott
Jon Onstott

Reputation: 13727

It looks like some additional CSS is needed in order to be able to set ScrollPane backgrounds to whatever color you like. See this question:

ScrollPanes in JavaFX 8 always have gray background

Upvotes: 2

Related Questions