aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Resizing JRadioButton Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Resizing JRadioButton" Watch "Resizing JRadioButton" New topic
Author

Resizing JRadioButton

Farhad Rahmati
Ranch Hand

Joined: Dec 16, 2010
Posts: 96
is it possible to resize JRadio Button?

I mean the circle, not the text. I want to resize the Radio button make it bigger for touch screen application. as it's size it very small


Thanks
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19783
    
  20

That's an icon, and you can set and get it from the radio button. Well, not "it" - "them". There's at least two of them; play around with the setIcon and setXXXIcon methods.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4664
    
    5

Actually, in the default Metal LaF at least, it's just one Icon* which reacts to rollover/pressed/selected states by casting the Component passed to its paintIcon method to a JRadioButton and retrieving its model.

* private class javax.swing.plaf.metal.MetalIconFactory.RadioButtonIcon, obtainable via public static Icon getRadioButtonIcon()

Farhad, one easy way to get a larger circle could be to layer your own Icon, which simply draws a circle of the desired size, with the default Icon. See the HCenter/VCenter alignment sample on
http://tips4java.wordpress.com/2009/03/25/toggle-button-icons/


luck, db
There are no new questions, but there may be new answers.
Farhad Rahmati
Ranch Hand

Joined: Dec 16, 2010
Posts: 96
Darryl Burke and Rob Spoor

Thank you very much for this information, I was thinking about Icon, but never tried. Yea I will have a go


Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Resizing JRadioButton