1

Hi I need to add a Round Border, that could be etched, beveled etc. for a JRadioButton. to allow the button to keep its round appearance.

but i cannot find any round borders.

does anyone know how to do this? chis

skaffman
  • 398,947
  • 96
  • 818
  • 769
f1wade
  • 2,877
  • 6
  • 27
  • 43

2 Answers2

2

You can implement the Border interface, using drawRoundRect() or drawOval() in paintBorder().

trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • 1
    and, of course, set the border to the radio button: `radioButton.setBorder(new Border() {...});` – Mot Dec 02 '10 at 14:36
1

thanks thats one option, but im trying not to add my own implementation, as that would then limit reusability of the software by others.

i currently had JRadioButton.setBorder(new EchtedBorder(..)); JRadioBUtton.setBorderPainted(true); //to make it actually be drawn for the radiobutton.

but it then appears square, with the default radiobutton (thats round) inside.

I wondered if there was ay way to get the radiobutton to obay its natural roundness?

f1wade
  • 2,877
  • 6
  • 27
  • 43