gpt4 book ai didi

JavaFX:设置 ProgressIndicator 文本标签的颜色

转载 作者:行者123 更新时间:2023-11-30 03:08:02 27 4
gpt4 key购买 nike

我想更改附加到 ProgressIndicator 的文本标签的颜色,因为默认文本颜色是黑色,而且我的背景也是黑色。

到目前为止我已经尝试过:

ProgressIndicator pg = new ProgressIndicator(0);
pg.setStyle("-fx-foreground-color: #FF00000");

但是好像没用。

需要注意的重要事项:我在确定模式下使用 ProgressIndicator。

最佳答案

未经测试,但根据documentation ,你应该能够做到

.progress-indicator .percentage {
-fx-fill: #ff0000 ;
}

在外部样式表中。

(请注意,您的颜色规范中似乎也有太多数字。)

关于JavaFX:设置 ProgressIndicator 文本标签的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34271659/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com