1

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

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

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

但它似乎没有用。

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

4

1 回答 1

2

未经测试,但根据文档,您应该可以做到

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

在外部样式表中。

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

于 2015-12-14T16:34:09.673 回答