Re: Size of a radiobutton
- From: Frank Meyer <f.meyer@xxxxxxxxxxxx>
- Date: Wed, 23 Apr 2008 16:47:13 +0200
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");
}
}
}
.
- Follow-Ups:
- Re: Size of a radiobutton
- From: Andre Rothe
- Re: Size of a radiobutton
- References:
- Size of a radiobutton
- From: Andre Rothe
- Size of a radiobutton
- Prev by Date: Graphics2D.drawImage() and clipping region
- Next by Date: Re: Graphics2D.drawImage() and clipping region
- Previous by thread: Size of a radiobutton
- Next by thread: Re: Size of a radiobutton
- Index(es):