Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #3423

Re: Size of a radiobutton

From "Frank Meyer" <frank.meyer@THRWHITE.remove-dii-this>
Subject Re: Size of a radiobutton
Message-ID <480f4bea$0$6781$9b4e6d93@newsspool2.arcor-online.net> (permalink)
Newsgroups comp.lang.java.gui
References <fumvgj$4gk$1@aioe.org>
Date 2011-04-27 15:44 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
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

import javax.swing.*;

public class ButtonIconResolver {
  /**
   * extracted from BasicRadioButtonUI
   * @param b
   * @return
   */
  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");
   }
  }
}

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Size of a radiobutton "Andre Rothe" <andre.rothe@THRWHITE.remove-dii-this> - 2011-04-27 15:44 +0000
  Re: Size of a radiobutton "Frank Meyer" <frank.meyer@THRWHITE.remove-dii-this> - 2011-04-27 15:44 +0000
  Re: Size of a radiobutton "tar" <tar@THRWHITE.remove-dii-this> - 2011-04-27 15:44 +0000

csiph-web