簡體   English   中英

JavaFX:設置ProgressIndicator文本標簽的顏色

[英]JavaFX: Set the color of a ProgressIndicator's text label

我想更改附加到ProgressIndicator上的文本標簽的顏色,因為默認的文本顏色是黑色,而我的背景也是黑色。

到目前為止,我已經嘗試過了:

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

但它似乎沒有用。

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

未測試,但根據文檔 ,您應該可以

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

在外部樣式表中。

(請注意,您的顏色規格中似乎也有太多數字。)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM