JFileChooser 中的 UIManager 颜色
我正在使用 Nimbus 外观和感觉,其颜色仅发生 3 处变化:
UIManager.put("nimbusSelection", new Color(164,164,164));
UIManager.put("nimbusSelectionBackground", new Color(214,217,223));
UIManager.put("nimbusSelectedText", Color.BLACK);
我的 FileChooser 如下所示:
因此,所选文件的名称显示为白色,看起来很糟糕,并且在组合框中选择的文件类型也会发生这种情况。我想将其更改为黑色,但 nimbusSelectedText 已经是黑色并且不起作用。
我还查看了 Nimbus 默认指南 http:// /download.oracle.com/javase/tutorial/uiswing/lookandfeel/_nimbusDefaults.html#primary 我在以下位置看不到参数FileChooser 或 Combobox 可以解决此问题。
有帮助确定必要的参数吗?谢谢
I'm using Nimbus Look and Feel, with only 3 changes at its colors:
UIManager.put("nimbusSelection", new Color(164,164,164));
UIManager.put("nimbusSelectionBackground", new Color(214,217,223));
UIManager.put("nimbusSelectedText", Color.BLACK);
My FileChooser looks like this:
So selected file's name appears in white and looks bad, and it also happens for the file type selected at the combobox. I want to change it to Black, but nimbusSelectedText is already black and is not working.
I also had a look at the Nimbus Defaults guide at http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/_nimbusDefaults.html#primary and i see no parameter at FileChooser or Combobox to fix this.
Any help identifying the necessary parameters? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
JFileChooser 是复合的 JComponent,解压即可
JButtons
、JToggleButtons
和 带有包含 JList 的 JViewPort 的 JScrollPane,请下载 Darryl 的 Swing Utils ,阅读说明,然后运行(Darryl 的)代码,结果是选择 JList 或 JTable(我投票赞成)JFileChooser is compound JComponent, you can extract
JButtons
,JToggleButtons
and JScrollPane with JViewPort that contains JList, please download Darryl's Swing Utils , read descriptions, then run (Darryl's) code, result is selection for JList or JTable (I voting for that)嗯,有一种方法可以做到这一点。您可以从 JFileChooser 获取 JList 并修改它:
要使用它,只需调用
getJList()
:Well, there is one way possible to do it. You can get the JList from your JFileChooser and modify it:
and to use it, just call
getJList()
:我真的不知道,但是您是否尝试过设置此属性:
FileChooser 看起来非常像列表...
第二次尝试。也许这些设置有帮助:
I really don't know, but have you tried setting this properties:
A FileChooser looks pretty much like a list...
Second try. Maybe settings these helps: