* a JCheckBox or JRadioButton. If the component is not a JCheckBox or
* JRadioButton, 0 will be returned.
*/
int getButtonChildIndent(JComponent c, int position) {
if ((c instanceof JRadioButton) || (c instanceof JCheckBox)) {
AbstractButton button = (AbstractButton)c;
Insets insets = c.getInsets();
Icon icon = getIcon(button);
int gap = button.getIconTextGap();
if (isLeftAligned(button, position)) {
return insets.left + icon.getIconWidth() + gap;
} else if (isRightAligned(button, position)) {
return insets.right + icon.getIconWidth() + gap;
}