由于我想让这个颜色应用程序更广泛,所以这是最好的方法:
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



