or we should change the radioButton's selectedIcon ?
there isn't
radioButton's selectedIcon
, everything is done inpaintIcon
(with two states)you can to override
paintIcon
inBasicRadioButtonUI
EDIT
there are two ways,
depends of Java version and used L&F, have to test
@Override
public void paintIcon(Component c, Graphics g, int x, int y) {
int offset = (c.getHeight() - iconSide) / 2;
g.setColor(Color.red);
g.fillOval(x + offset, y + offset, dotDia, dotDia);
}
// or
@Override
public void paintIcon(Component c, Graphics g, int x, int y) {
int offset = (c.getHeight() - iconSide) / 2;
g.setColor(Color.red);
g.fillRoundRect(x + offset, y + offset, dotDia, dotDia, arc, arc);
}
or (dirty way) to setIcon
(prepared) in UIManager
, required to set revalidate()
and repaint()
for all mouse or key events