In ButtonGroup.add() we need to check if the added button is already selected, and if this is the case, deselect all the other buttons. This is fixed by the attached patch.
2006-05-08 Roman Kennke <[EMAIL PROTECTED]>
PR 27480
* javax/swing/ButtonGroup.java
(add): Check if new button is selected and if so, deselect other
buttons in the group.
/Roman
--
“Improvement makes straight roads, but the crooked roads, without
Improvement, are roads of Genius.” - William Blake
Index: javax/swing/ButtonGroup.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/ButtonGroup.java,v
retrieving revision 1.12
diff -u -1 -0 -r1.12 ButtonGroup.java
--- javax/swing/ButtonGroup.java 20 Oct 2005 20:21:29 -0000 1.12
+++ javax/swing/ButtonGroup.java 8 May 2006 14:05:30 -0000
@@ -84,22 +84,26 @@
/**
* Adds a button to this group.
*
* @param b the button to add
*/
public void add(AbstractButton b)
{
b.getModel().setGroup(this);
if (b.isSelected())
- sel = b.getModel();
- buttons.addElement(b);
+ {
+ if (sel == null)
+ sel = b.getModel();
+ else
+ b.setSelected(false);
+ } buttons.addElement(b);
}
/**
* Removed a given button from this group.
*
* @param b the button to remove
*/
public void remove(AbstractButton b)
{
b.getModel().setGroup(null);
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
