【问题标题】:JavaFX: Set the color of a ProgressIndicator's text labelJavaFX:设置 ProgressIndicator 的文本标签的颜色
【发布时间】:2016-03-20 04:57:49
【问题描述】:

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

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

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

但它似乎没有用。

重要提示:我在确定模式下使用 ProgressIndicator。

【问题讨论】:

    标签: java css javafx colors progress-indicator


    【解决方案1】:

    未测试,但根据documentation,你应该可以做到

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

    在外部样式表中。

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

    【讨论】:

      猜你喜欢
      • 2018-09-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-22
      • 2011-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多