diff options
author | David Gilbert <david.gilbert@object-refinery.com> | 2005-10-11 20:44:29 +0000 |
---|---|---|
committer | David Gilbert <david.gilbert@object-refinery.com> | 2005-10-11 20:44:29 +0000 |
commit | 2a0c050f022c7b04e7790fc27ebd82016c71a1f4 (patch) | |
tree | 02c49a1973a20d58952004c1a8e20c5046b8afee /javax/swing/DefaultComboBoxModel.java | |
parent | 67bb7d4e0d04e79f1c38310a6dbdbf1a4e624c38 (diff) | |
download | classpath-2a0c050f022c7b04e7790fc27ebd82016c71a1f4.tar.gz |
2005-10-11 David Gilbert <david.gilbert@object-refinery.com>
* javax/swing/DefaultComboBoxModel.java
(setSelectedItem): allow values not in list, and don't fire an event
if the value is unchanged.
Diffstat (limited to 'javax/swing/DefaultComboBoxModel.java')
-rw-r--r-- | javax/swing/DefaultComboBoxModel.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/javax/swing/DefaultComboBoxModel.java b/javax/swing/DefaultComboBoxModel.java index c564cf720..ea261a33b 100644 --- a/javax/swing/DefaultComboBoxModel.java +++ b/javax/swing/DefaultComboBoxModel.java @@ -222,9 +222,18 @@ public class DefaultComboBoxModel extends AbstractListModel */ public void setSelectedItem(Object object) { + if (selectedItem == null) + { + if (object == null) + return; + } + else + { + if (selectedItem.equals(object)) + return; + } selectedItem = object; - if(object == null || list.contains(object)) - fireContentsChanged(this, -1, -1); + fireContentsChanged(this, -1, -1); } /** |