-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.1.7
-
x86
-
windows_nt
Name: el35337 Date: 10/05/98
JComboBox removeAllItems method is throwing exception. Similar to but#4138253. The suggested workaround gets into infinite loop. I'm using swing103 and jdk117.
Example code:
import com.sun.java.swing.*;
import java.awt.*;
import java.awt.event.*;
public class TestCombo extends JComboBox implements ItemListener {
public TestCombo() {
super();
addItem("one");
addItem("two");
addItem("three");
addItemListener(this);
}
public void itemStateChanged(ItemEvent e) {
this.removeAllItems();
this.addItem("A");
this.addItem("B");
this.addItem("C");
}
public static void main(String argc[]){ JFrame f = new JFrame("testing");
TestCombo tc = new TestCombo();
f.getContentPane().setLayout(new FlowLayout());
f.getContentPane().add(tc);
f.setSize(150,100);
f.setVisible(true);
}
}
(Review ID: 39989)
======================================================================
- duplicates
-
JDK-4167850 (DLSM bug?) JComboBox.removeAllItems execptions on empty list
-
- Resolved
-