JavaFX背景颜色使用三种颜色

时间:2019-05-31 12:55:20

标签: java javafx

如何在javafx中创建这种类型的背景(白色,黑色,白色)?

我尝试了-fx-background-color: white, black, white;,但不是我想要的。

1 个答案:

答案 0 :(得分:2)

我设法提出了CSS样式,结果是: Inner Circles example

.circle-background{
    -fx-background-color: black, white; /* 2nd inner color, 3rd inner color*/
    -fx-background-insets: 10,60; /*2nd inner ring, 3rd inner ring */
    -fx-background-radius: 50%;
    -fx-border-width: 10;   /* outer ring width */
    -fx-border-color: white;/* outer ring color */
    -fx-border-radius: 50%;
}
相关问题