在Swing中设置JComboBox的背景

在Swing中设置JComboBox的背景,第1张

在Swing中设置JComboBox的背景

由于我想让这个颜色应用程序更广泛,所以这是最好的方法:

UIManager.put("ComboBox.background", new ColorUIResource(UIManager.getColor("TextField.background")));UIManager.put("ComboBox.foreground", new ColorUIResource(UIManager.getColor("TextField.foreground")));UIManager.put("ComboBox.selectionBackground", new ColorUIResource(Color.GREEN));UIManager.put("ComboBox.selectionForeground", new ColorUIResource(Color.WHITE));

如果要自定义更多(禁用的颜色等),则UIManager属性的此列表可能会很有用:http
:
//www.rgagnon.com/javadetails/JavaUIDefaults.txt



欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5430359.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-12-11
下一篇2022-12-11

发表评论

登录后才能评论

评论列表(0条)

    保存