This patch (committed) removes the event notification from the setGroup()
method:
2006-05-16 David Gilbert <[EMAIL PROTECTED]>
* javax/swing/DefaultButtonModel.java
(setGroup): Removed event notification.
My Swing book (O'Reilly's Java Swing) lists the fields for which a ChangeEvent is
generated, and 'group' isn't one of them. A Mauve test confirms that the reference
implementation doesn't generate an event here.
Regards,
Dave
Index: javax/swing/DefaultButtonModel.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/DefaultButtonModel.java,v
retrieving revision 1.27
diff -u -r1.27 DefaultButtonModel.java
--- javax/swing/DefaultButtonModel.java 16 May 2006 15:30:56 -0000 1.27
+++ javax/swing/DefaultButtonModel.java 16 May 2006 19:34:07 -0000
@@ -1,5 +1,5 @@
/* DefaultButtonModel.java --
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2006, Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -63,7 +63,7 @@
* change to the "selected" property will trigger the firing of an ItemEvent
* in addition to ChangeEvent. This is true whether the model is enabled or
* not. One other state change is special: the transition from "enabled,
- * armed and pressd" to "enabled, armed and not-pressed". This is considered
+ * armed and pressed" to "enabled, armed and not-pressed". This is considered
* the "trailing edge" of a successful mouse click, and therefore fires an
* ActionEvent in addition to a ChangeEvent. In all other respects this class
* is just a container of boolean flags.
@@ -555,21 +555,21 @@
* one model in a given group can have their "selected" property be
* <code>true</code> at a time.
*
- * @param g The new "group" property
+ * @param g The new "group" property (<code>null</code> permitted).
+ *
+ * @see #getGroup()
*/
public void setGroup(ButtonGroup g)
{
- if (group != g)
- {
- group = g;
- fireStateChanged();
- }
+ group = g;
}
/**
* Returns the current value of the model's "group" property.
*
* @return The value of the "group" property
+ *
+ * @see #setGroup(ButtonGroup)
*/
public ButtonGroup getGroup()
{