简体   繁体   中英

How do you dynamically change the background color of a JavaFX MenuItem at runtime?

该类中没有setBackground方法,并且setStyle(“-fx-background-color:green;”)似乎无效。

查找此线程 ,尽管在使用MenuItems时setStyle和“ -fx-background-color:green”也应适用于文本的background-color

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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