diff options
Diffstat (limited to 'libjava/classpath/java/awt/Checkbox.java')
-rw-r--r-- | libjava/classpath/java/awt/Checkbox.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libjava/classpath/java/awt/Checkbox.java b/libjava/classpath/java/awt/Checkbox.java index cd39ad43617..93f60924723 100644 --- a/libjava/classpath/java/awt/Checkbox.java +++ b/libjava/classpath/java/awt/Checkbox.java @@ -392,6 +392,11 @@ Checkbox(String label, boolean state, CheckboxGroup group) this.label = label; this.state = state; this.group = group; + + if ( state && group != null ) + { + group.setSelectedCheckbox(this); + } } /*************************************************************************/ @@ -610,8 +615,10 @@ dispatchEventImpl(AWTEvent e) protected String paramString() { - return ("label=" + label + ",state=" + state + ",group=" + group - + "," + super.paramString()); + // Note: We cannot add the checkbox group information here because this + // would trigger infinite recursion when CheckboxGroup.toString() is + // called and the box is in its selected state. + return ("label=" + label + ",state=" + state + "," + super.paramString()); } /** |