-1

I want to make the white circles of JRadioButtons transparent. How can I do that? setOpaque(false) only removes the background from text and not the circle.

Roman C
  • 49,761
  • 33
  • 66
  • 176
Asalas77
  • 249
  • 5
  • 13

2 Answers2

1

Create custom Icons that use transparency for the radio button. See methods like:

setIcon(...);
setSelectedIcon(...);
camickr
  • 321,443
  • 19
  • 166
  • 288
  • I put blank 10x10 px .png file as icon, but this also removed the circle (border). Is there any way to keep it or I just have to draw it on the icon? – Asalas77 Jun 04 '14 at 17:08
  • You need to create a custom Icon that draws everything the way you want it to appear and you need to set transparent pixels where you want the icon to be transparent. These Icons replace the default Icons used by the radio button. – camickr Jun 04 '14 at 17:12
0
jRadioButton1.setVisible(false);
André Ferraz
  • 1,511
  • 11
  • 29