简体   繁体   English

聚焦时如何在javafx中更改菜单颜色

[英]How to change the menu color in javafx when it is focused

在此处输入图片说明

This is a menu and when I focus it, it is blue. 这是一个菜单,当我聚焦它时,它是蓝色的。 How to change the color using CSS? 如何使用CSS更改颜色?

I tried this: 我尝试了这个:

ainmenubar.setStyle("-fx-focus-color: #555555;");

But it does not work. 但这行不通。

用于查找的颜色是-fx-selection-bar :试试

ainmenubar.setStyle("-fx-selection-bar: #555555;");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM