X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTRadioGroup.java;h=d6bd7ff38ee34c2b71a3546fb1cf1347e29c1dfe;hb=HEAD;hp=7f8c99c404e31c410aa6b4ad1a0f7dda17606c20;hpb=b2efac6ed4525f77cbcb717a082d3a2884c91936;p=fanfix.git diff --git a/src/jexer/TRadioGroup.java b/src/jexer/TRadioGroup.java index 7f8c99c..d6bd7ff 100644 --- a/src/jexer/TRadioGroup.java +++ b/src/jexer/TRadioGroup.java @@ -60,6 +60,24 @@ public class TRadioGroup extends TWidget { // Constructors ----------------------------------------------------------- // ------------------------------------------------------------------------ + /** + * Public constructor. + * + * @param parent parent widget + * @param x column relative to parent + * @param y row relative to parent + * @param width width of group + * @param label label to display on the group box + */ + public TRadioGroup(final TWidget parent, final int x, final int y, + final int width, final String label) { + + // Set parent and window + super(parent, x, y, width, 2); + + this.label = label; + } + /** * Public constructor. * @@ -239,7 +257,7 @@ public class TRadioGroup extends TWidget { public void setRequiresSelection(final boolean requiresSelection) { this.requiresSelection = requiresSelection; if (requiresSelection) { - if (getChildren().size() > 0) { + if ((getChildren().size() > 0) && (selectedButton == null)) { setSelected(1); } }