简体   繁体   English

在Swing中获取“胖标题”背景色

[英]Get “fat header” background color in Swing

I'm building a Swing app in which I'd like to put a "fat header" as in this image: 我正在构建一个Swing应用程序,在该应用程序中,我想放置一个“胖标题”,如下图所示:

在此处输入图片说明

Is there a nice way to get the native system colour for that background area? 有没有一种很好的方法来获取该背景区域的本机系统颜色? So on Ubuntu with a default theme I'd like to get the colour in the image, but for other themes, and on Windows, I'd also like to have something sensible. 因此,在具有默认主题的Ubuntu上,我想获得图像中的颜色,但是对于其他主题,在Windows上,我还想获得一些有意义的信息。 I'm using the native Look & Feel. 我正在使用本机的外观。

例如 ,FatHeader可能是JMenuBar或带有GradientPaint JPanel (非常简单,是从JButton's JComponents获取此Gradient[]

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

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