Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java GUI > Re: Size of a r...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 6 Topic 9667 of 9964
Post > Topic >>

Re: Size of a radiobutton

by Frank Meyer <f.meyer@[EMAIL PROTECTED] > Apr 23, 2008 at 04:47 PM

Andre Rothe wrote:
> the size of the clickable unchangable circle

Hi Andre,
this is the radiobutton-icon.
Below is a code-snippet.
Hope this helps
Frank

im****t javax.swing.*;

public class ButtonIconResolver {
  /**
   * extracted from BasicRadioButtonUI
   * @[EMAIL PROTECTED]
 b
   * @[EMAIL PROTECTED]
   */
  public static Icon getIcon(JRadioButton b) {
   ButtonModel model = b.getModel();
   Icon icon = b.getIcon();
   if (icon != null) {
    if (!model.isEnabled()) {
     if (model.isSelected()) {
      icon = b.getDisabledSelectedIcon();
     } else {
      icon = b.getDisabledIcon();
     }
    } else if (model.isPressed() && model.isArmed()) {
     icon = b.getPressedIcon();
     if (icon == null) {
      icon = b.getSelectedIcon();
     }
    } else if (model.isSelected()) {
     if (b.isRolloverEnabled() && model.isRollover()) {
      icon = b.getRolloverSelectedIcon();
      if (icon == null) {
       icon = b.getSelectedIcon();
      }
     } else {
      icon = b.getSelectedIcon();
     }
    } else if (b.isRolloverEnabled() && model.isRollover()) {
     icon = b.getRolloverIcon();
    }
    if (icon == null) {
     icon = b.getIcon();
    }
    return icon;
   } else {
    return UIManager.getIcon("RadioButton.icon");
   }
  }
}
 




 6 Posts in Topic:
Size of a radiobutton
Andre Rothe <andre.rot  2008-04-23 11:14:23 
Re: Size of a radiobutton
Frank Meyer <f.meyer@[  2008-04-23 16:47:13 
Re: Size of a radiobutton
Andre Rothe <andre.rot  2008-04-25 16:41:01 
Re: Size of a radiobutton
tar@[EMAIL PROTECTED] (T  2008-04-25 08:49:13 
Re: Size of a radiobutton
Andre Rothe <andre.rot  2008-04-26 11:26:47 
Re: Size of a radiobutton
tar@[EMAIL PROTECTED] (T  2008-04-28 14:46:14 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 13 20:55:59 CDT 2008.