简体   繁体   English

JavaFX:JMetro 更改进度条颜色

[英]JavaFX: JMetro change Progress bar color

I am using JMetro 's indeterminate progress bar.我正在使用JMetro的不确定进度条。 From the documentation, i use the below css to have a fade in effect:从文档中,我使用下面的css来淡入淡出效果:

.progress-bar:indeterminate .dot_1 {
    -fx-background-color: ACCENT_COLOR;
}

.progress-bar:indeterminate .dot_2 {
    -fx-background-color: derive(ACCENT_COLOR, -15%);
}

.progress-bar:indeterminate .dot_3 {
    -fx-background-color: derive(ACCENT_COLOR, -30%);
}

.progress-bar:indeterminate .dot_4 {
    -fx-background-color: derive(ACCENT_COLOR, -45%);
}

.progress-bar:indeterminate .dot_5 {
    -fx-background-color: derive(ACCENT_COLOR, -60%);
}

This works as expected .这按预期工作。 But the progress bar color is default blue and i want to change it to white.但是进度条颜色默认为蓝色,我想将其更改为白色。

Simply changing the -fx-background-color: white or adding -fx-accent:white is not working.简单地更改-fx-background-color: white或添加-fx-accent:white是行不通的。

How can i do it ?我该怎么做 ?

-fx-background-color: white而不是使用颜色名称。使用相应颜色的十六进制值解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM