本文介绍了更改JCheckBox/JRadioButton选择颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以更改复选框/单选按钮的选择颜色?
Is there a way to change the selection color of a checkbox/radiobutton?
推荐答案
这是针对JCheckBox的方法
Here is how to do it for a JCheckBox
UIManager.put("CheckBox.focus",Color.RED);
这里有一个不错的工具: http://tips4java.wordpress. com/2008/10/09/uimanager-defaults/,如果您运行Java Web Start程序,则可以浏览每个组件的键和值.
There is a nice tool here: http://tips4java.wordpress.com/2008/10/09/uimanager-defaults/ that if you run the Java Web Start program it will allow you to browse the keys and values for each component.
这篇关于更改JCheckBox/JRadioButton选择颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!