This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gui][patch] fix to button group logic


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);
       }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]