I try to style a SplitMenuButton in JavaFX. I've got a menuButton and a SplitMenuButton in my fxml-file.

My CSS-File looks like this:

.menu-button {
-fx-background-color: red;
} .split-menu-button .label {
-fx-background-color: green;
} .split-menu-button .arrow {
-fx-background-color: yellow;
}

But I can't figure out how to style the area around the arrow for the SplitMenuButton. I tried several ways, but nothing worked

.split-menu-button .menu-button {
-fx-background-color: blue;
} .split-menu-button .menu-button .label {
-fx-background-color: blue;
} .split-menu-button .menu{
-fx-background-color: blue;
} .split-menu-button .menu-item {
-fx-background-color: blue;
} .split-menu-button .button {
-fx-background-color: blue;
} .split-menu-button .menu-bar {
-fx-background-color: blue;
}
asked May 13 at 10:20

Stef
32
 

1 Answer

up vote
2
down vote

accepted

There are two useful techniques for figuring out the style classes for individual parts of complex components like this:

  1. Extract the default style sheet, modena.css, from the jfxrt.jar file
    and see how the default styles are defined (you can also find modena.css online)
  2. Use ScenicView to inspect your application when it's running

In this case I used ScenicView; the css you need is

.split-menu-button .arrow-button {
-fx-background-color: yellow ;
}

最新文章

  1. 微信测试服务器验证sha1加密法,工具类
  2. JavaScript模块化
  3. Centos 6.5 rsync+inotify 两台服务器文件实时同步
  4. sql 指定值排序
  5. Java学习----接口
  6. [转]Kafka/Metaq设计思想学习笔记
  7. 自适应SimpsonSimpson积分
  8. C#验证IP地址
  9. iOS Socket第三方开源类库 ----AsyncSocket 分类: ios相关 ios技术 2015-03-11 22:14 59人阅读 评论(0) 收藏
  10. 014 一对多关联映射 单向(one-to-many)
  11. div的替代品
  12. 2017最新xcode打包APP详细图文
  13. Java多线程Master-Worker模式
  14. 基本服务器的AAA实验(Cisco PT)
  15. 文艺平衡树 Splay 学习笔记(1)
  16. The Art of Unit Testing With Examples in .NET
  17. 【CH5302】金字塔 区间DP
  18. 搭建 zookeeper + dubbo-admin + dubbo-monitor 环境
  19. json.dumps(),json.loads(),json.dump(),json.load()方法的区别
  20. 【Unity】计时器

热门文章

  1. Viewpager模仿微信主布局的三种方式 ViewPager,Fragment,ViewPager+FragmentPagerAdapter
  2. Ubuntu 16.04 LTS安装好需要设置的15件事(喜欢新版本)
  3. Opencv step by step - 自适应阈值
  4. 20145215《Java程序设计》第10周学习总结
  5. 学习笔记——Maven实战(九)打包的技巧
  6. MATLAB代码加密生成.p文件
  7. 云计算之路-阿里云上:Wireshark抓包分析一个耗时20秒的请求
  8. [BZOJ1271][WC2008]秦腾与教学评估(巧妙的二分)
  9. [wikioi 1418]铃仙•优昙华院稻叶(东方幻想乡系列模拟赛)(树上递推)
  10. 第二课:判断js变量的类型以及domReady的原理