File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes How to give color for JRadioButtons? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to give color for JRadioButtons? " Watch "How to give color for JRadioButtons? " New topic
Author

How to give color for JRadioButtons?

Renjith mohanan
Ranch Hand

Joined: Jun 19, 2009
Posts: 52
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


Personal E-mail: kalliyoorrenjith@gmail.com
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

You can change the Icon of a JRadioButton.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Renjith mohanan
Ranch Hand

Joined: Jun 19, 2009
Posts: 52
Thanks Rob,
I used the code



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

Thanks.
Rob....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to give color for JRadioButtons?