This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gui][patch] fix to button group logic
- From: "graydon hoare" <graydon at redhat dot com>
- To: "java-patches.gcc.gnu.org" <java-patches at gcc dot gnu dot org>
- Date: Fri, 27 Aug 2004 11:16:17 -0400
- Subject: [gui][patch] fix to button group logic
- Organization: red hat
hi,
this patch fixes DefaultButtonModel.java to check the button group
for null before trying to update it with state changes.
committed to java-gui-branch.
-graydon
2004-08-27 Graydon Hoare <graydon@redhat.com>
* javax/swing/DefaultButtonModel.java:
Skip group notification when no group is set.
--- javax/swing/DefaultButtonModel.java 25 Aug 2004 21:49:46 -0000 1.5.2.4
+++ javax/swing/DefaultButtonModel.java 27 Aug 2004 15:14:48 -0000
@@ -339,6 +339,7 @@
{
fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED,
null, ItemEvent.SELECTED));
+ if (group != null)
group.setSelected(this, true);
}
@@ -346,6 +347,7 @@
{
fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED,
null, ItemEvent.DESELECTED));
+ if (group != null)
group.setSelected(this, false);
}