2016-06-20 4 views

答えて

1

AlertためModena.cssスタイリングは、関心のセレクタは次のようになり、詳細ボタンについては〜ライン3339

からhere提供されています:

.dialog-pane > .button-bar > .container > .details-button { 
    -fx-alignment: baseline-left; 
    -fx-focus-traversable: false; 
    -fx-padding: 0.416em; /* 5px */ 
} 

.dialog-pane > .button-bar > .container > .details-button.more { 
    -fx-graphic: url("dialog-more-details.png"); 
} 

.dialog-pane > .button-bar > .container > .details-button.less { 
    -fx-graphic: url("dialog-fewer-details.png"); 
} 

.dialog-pane > .button-bar > .container > .details-button:hover { 
    -fx-underline: true; 
} 


例:

CSS:

.dialog-pane > .button-bar > .container > .details-button.more { 
    -fx-background-color: red; 
} 

.dialog-pane > .button-bar > .container > .details-button.less { 
    -fx-background-color: green; 
} 

enter image description here enter image description here


更新:

あなたはまた-fx-graphicを変更することで、画像を変更することができますが、画像が希望の大きさでなければなりません。あなたの答えのためにたくさんThabks

.dialog-pane > .button-bar > .container > .details-button.more { 
    -fx-graphic: url("unchecked_checkbox.png"); 
} 

.dialog-pane > .button-bar > .container > .details-button.less { 
    -fx-graphic: url("checked_checkbox.png"); 
} 

un-marked checkbox marked checkbox

+0

:下の画像は、24×24のアイコン

CSSを使用します。それは魅力のように機能します!ボタンをチェックボックスに変更できますか? – Subhranil

+0

しかし、テキストが変更されます。それを修正するには? – Subhranil

+0

詳細をお寄せいただきありがとうございます。しかし、私はあなたの編集の前にそれをすることができました。私が尋ねるのは、textPropertyが変更されないというチェックボックスをクリックすることです。ここではボックスの画像はテキストだけでなく変化しています。私はテキストを "詳細を表示"のままにして、イメージがアクティブな状態であることをユーザーに伝えます。 – Subhranil

関連する問題