set background color in scrollpane


Question

I have set background color in scrollpane using setStyle() method. the below code is working fine in up to "jdk-8-ea-bin-b109" java version after that java versions, these commend is not working properly but while mouse over the color has been applying.

My code is:

scrlPane.setStyle("-fx-background-color:#434547;");

1
1
11/21/2013 10:37:52 AM

From a question I created in regards to ScrollPane background colors in JavaFX 8: ScrollPanes in JavaFX 8 always have gray background

You may need to use this CSS so that ScrollPane styling can actually work:

.scroll-pane > .viewport {
   -fx-background-color: transparent;
}
2
5/23/2017 12:21:23 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon