• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Resizing JRadioButton

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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/
 
Farhad Rahmati
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic