-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
1.3.0
-
generic
-
generic
Name: yyT116575 Date: 02/08/2001
java version "1.3.0beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0beta-b07)
Java HotSpot(TM) Client VM (build 1.3.0beta-b04, mixed mode)
When a JComboBox is constructed with a Vector, and you call .removeAllItems()
on the JComboBox instead of derefferencing the Vector from the JComboBox
or derefferencing all items from the JCombobox, it deletes all items from the Vector itself.
This gave me problems with caching combobox items in my Localized version of my gui.
Please let me know if this is a bug or a feature, i can work around this problem but I would
not like to.
import javax.swing.JComboBox;
import java.util.Vector;
public class JComboBug {
public static void main(String args[]) {
Vector myVector = new Vector();
myVector.add("test1");
myVector.add("test2");
myVector.add("test3");
JComboBox myBox = new JComboBox(myVector);
System.out.println(myVector.size());
myBox.removeAllItems();
System.out.println(myVector.size());
}
}
output:
3
0
(Review ID: 116589)
======================================================================
- duplicates
-
JDK-6440832 JComboBox function removeAllItems destroys Vector data
-
- Closed
-