• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to give color for JRadioButtons?

 
Renjith mohanan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,

I need to give color for JRadioButtons (Not the background and foreground color, I need to create radio buttons as traffic signal lights). At a time any one of the buttons has the selected state. Is there any way to do that in JRadioButtons.

Any help will be appreciable......


Thanks...
Renjith M
 
Rob Spoor
Sheriff
Pie
Posts: 20514
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can change the Icon of a JRadioButton.
 
Renjith mohanan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rob,
I used the code



Then I create an object of RoundlIcon (Color.RED) and set the icon for the JRadioButton .

Thanks.
Rob....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic