How to change the highlighting color in JavaFX?

后端 未结 3 1168
春和景丽
春和景丽 2021-02-14 23:09

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:

.ro         


        
3条回答
  •  旧时难觅i
    2021-02-14 23:57

    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.

提交回复
热议问题