f1wade
f1wade

Reputation: 2967

how to add a round border to a jradiobutton

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

Upvotes: 1

Views: 1864

Answers (2)

f1wade
f1wade

Reputation: 2967

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?

Upvotes: 1

trashgod
trashgod

Reputation: 205875

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

Upvotes: 2

Related Questions