Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue with background color in JavaFX 8

Tags:

Looks like there is an issue with setting background colors for panels in JavaFX 8.

I had been trying the below, but none of them set the appropriate background colors.

VBox panel = new VBox(); panel.setAlignment(Pos.TOP_LEFT);  // None of the below work panel.setStyle("-fx-background-color: #FFFFFF;"); panel.setBackground(new Background(new BackgroundFill(Color.WHITE, CornerRadii.EMPTY, Insets.EMPTY))); 

Is there something wrong in the way I am setting the background color? This used to work with earlier versions of JavaFX 2.2.

Thanks.

like image 220
Sirish V Avatar asked Mar 24 '14 16:03

Sirish V


1 Answers

panel.setStyle("-fx-background-color: #FFFFFF;"); 
like image 96
Sirish V Avatar answered Oct 08 '22 08:10

Sirish V