java - 如何更改 JavaFX 中的突出显示颜色?

标签 java css javafx-2 javafx

如何更改 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;
}

根据用途更改这些颜色。

关于java - 如何更改 JavaFX 中的突出显示颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14126468/

相关文章:

css - 为什么在使用 flex 时样式标签也得到 "style"?

JavaScript getComputedStyle 不适用于颜色名称?

java - 如何生成构建器类

javafx - javafx 2.1 中 FX.defer() 方法的等价物是什么

html - 如何获得相对于文本量css的边距

JavaFX 2.2 字体渲染有问题

当我运行另一个线程时,JavaFx 进度指示器卡住

java - 是否只有 Apache Axis wsdl2Java 还是有其他库?

java - 静态嵌套类可以访问外部类的私有(private)构造函数

java - RxJava : Call network multiple times with increasing delay, 忽略错误