This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to give color for JRadioButtons?

 
Renjith mohanan
Ranch Hand
Posts: 52
  • 0
  • 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: 20368
43
Chrome Eclipse IDE Java Windows
  • 0
  • 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
  • 0
  • 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....
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic