如何更改JavaFX中的突出显示颜色? [英] How to change the highlighting color in JavaFX?
本文介绍了如何更改JavaFX中的突出显示颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何更改JavaFX中的突出显示颜色?通常它是渐变的蓝色,但我希望有一个绿色突出显示。我尝试过以下方法:
.root {
-fx-shadow-highlight-color:#CCFF99;
}
感谢您的帮助!
caspian.css (JavaFX 2)或 modena.css (JavaFX 8)
$ b
$ b
.root {
/ *用于突出显示/重音对象的亮蓝色。例如:选择
*文本;菜单,列表,树和表中的选定项目;进度条;
*默认按钮。
* /
-fx-accent:#0093ff;
/ *对象焦点指示器的亮蓝色。通常用作聚焦伪类的-b $ b *第一种颜色-fx-background-color。另外
*通常与-1.4的插图一起使用以提供发光效果。
*
* TODO:这应该来自-fx-accent吗?
* /
-fx-focus-color:#0093ff;
}
根据用途更改这些颜色。
How to change the highlighting color in JavaFX? Usually it is blue with gradients, but I would like to have a green highlighting. I have tried the following:
.root{
-fx-shadow-highlight-color: #CCFF99;
}
Thanks for help!
解决方案
Look at caspian.css (JavaFX 2) or 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;
}
Change these colors according to their usages.
这篇关于如何更改JavaFX中的突出显示颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文