JavaFXで強調表示の色を変更するにはどうすればよいですか?通常は青でグラデーションが付いていますが、緑を強調したいのですが。私は以下を試しました:
.root{
-fx-shadow-highlight-color: #CCFF99;
}
手伝ってくれてありがとう!
caspian.css(JavaFX 2)またはmodena.css(JavaFX 8)を見てください
.root {
/* A bright blue for highlighting/accenting objects. For example: selected
* text; selected items in menus, lists, trees, and tables; progress bars;
* default buttons.
*/
-fx-accent: #0093ff;
/* A bright blue for the focus indicator of objects. Typically used as the
* first color in -fx-background-color for the "focused" pseudo-class. Also
* typically used with insets of -1.4 to provide a glowing effect.
*
* TODO: should this be derived from -fx-accent?
*/
-fx-focus-color: #0093ff;
}
用途に応じて色を変えてください。
UlukBiyはそれに素晴らしい方法で答えたと思います。
しかし、実際には、CSSを使用したスタイリングは-fx-focus-color:#0093ffをオーバーライドせず、オーバーラップします。-fx-focus-color:redを使用すると、デフォルトの青色と混合され、灰色のような色合いが表示されます。css属性-fx-accentには問題はありません。
クラスセレクター-fx-highlight-fill
でも使用できます。text-area
.text-area {
-fx-highlight-fill: green;
}