This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Originally posted by Bai Shen: Is there any way to make a radio button noneditable? I want to use them as an indicator of what's selected, but I don't want people to click and change the selection.
Do you mean JRadioButton or JCheckBox? No matter, either way this is what setEnabled(false) does. That will also cause the LnF to give an indication to the user that the button is disabled, usually by using a grey color.
If you want disabled behaviour without the greyed-out color (not necessarily recommended) you can either mess with the painting code or you can play tricks with the ButtonModel like this: