diff options
Diffstat (limited to 'libjava/classpath/javax/swing/ButtonGroup.java')
-rw-r--r-- | libjava/classpath/javax/swing/ButtonGroup.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libjava/classpath/javax/swing/ButtonGroup.java b/libjava/classpath/javax/swing/ButtonGroup.java index 3de1d4b9f16..94f0109e634 100644 --- a/libjava/classpath/javax/swing/ButtonGroup.java +++ b/libjava/classpath/javax/swing/ButtonGroup.java @@ -79,6 +79,7 @@ public class ButtonGroup implements Serializable */ public ButtonGroup() { + // Nothing to do here. } /** @@ -89,6 +90,8 @@ public class ButtonGroup implements Serializable public void add(AbstractButton b) { b.getModel().setGroup(this); + if (b.isSelected()) + sel = b.getModel(); buttons.addElement(b); } @@ -158,7 +161,7 @@ public class ButtonGroup implements Serializable { ButtonModel old = sel; sel = m; - + if (old != null) old.setSelected(false); AbstractButton button = FindButton(old); |