Issue with background color in JavaFX 8

后端 未结 3 1639
北海茫月
北海茫月 2021-02-12 13:40

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.<

3条回答
  •  后悔当初
    2021-02-12 14:07

    Try this one in your css document,

    -fx-background-color : #ffaadd;
    

    or

    -fx-base : #ffaadd; 
    

    Also, you can set background color on your object with this code directly.

    yourPane.setBackground(new Background(new BackgroundFill(Color.DARKGREEN, CornerRadii.EMPTY, Insets.EMPTY)));
    

提交回复
热议问题