2016-07-30 13 views
2

CSSスタイルシートを使用してjavafxスピナーのスタイルを変更しようとしています。CSSを使用してjavafxスピナーボタンのスタイルを変更

しかし、色を変更すると、テキストフィールドの色と矢印ボタンの色を変更することができますが、デフォルトのように見えます。

これらのボタンの色も変更できますか?

答えて

2

設定ボタンの背景として使用されて-fx-body-color

.spinner .increment-arrow-button, 
.spinner .decrement-arrow-button { 
    -fx-body-color: yellow; 
} 

.spinner .increment-arrow-button:hover, 
.spinner .decrement-arrow-button:hover { 
    /* interpolate color between yellow and red based on first color brightness */ 
    -fx-body-color: ladder(#444, yellow 0%, red 100%); 
} 

.spinner .increment-arrow-button:hover:pressed, 
.spinner .decrement-arrow-button:hover:pressed, 
.spinner .increment-arrow-button:pressed, 
.spinner .decrement-arrow-button:pressed { 
    /* interpolate color between yellow and red based on first color brightness */ 
    -fx-body-color: ladder(#AAA, yellow 0%, red 100%); 
} 

ものは、ボタンの背景色として、デフォルトのスタイルシートで使用されています。

+0

ありがとうございます!実際の矢の色をどうやって変えるのですか?ボタンを暗くすると、矢印アイコンの間に十分なコントラストがありません – FrancisG

+0

心配しないでください。私の問題はjavafxのCSSリファレンスガイドを正しく解釈していないということでした。 – FrancisG

関連する問題