Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help:JComboBox Problem

0 views
Skip to first unread message

li...@email.com

unread,
Aug 29, 2000, 3:00:00 AM8/29/00
to
I'm developing a SWING app in JBuilder 3.0. With the build-in JDK 1.2,
when clearing content of the Combobox(at the very begining it is
empty), I always get this problem. If switch to JDK 1.2.2, which is
downloaded and installed separately, the app works just fine. But I
have to stay with JDK 1.2 for a while. Anyone had same problem before?
Any workaround to suggest?

Thanks!

Li

=========The exception I got============
java.lang.IndexOutOfBoundsException: -1
at java.util.BitSet.get(Compiled Code)
at javax.swing.DefaultListSelectionModel.clear
DefaultListSelectionModel.java:201)
at javax.swing.DefaultListSelectionModel.setState
(DefaultListSelectionModel.java:405)
at javax.swing.DefaultListSelectionModel.removeIndexInterval
(DefaultListSelectionModel.java:457)
at
javax.swing.plaf.basic.BasicListUI$ListDataHandler.intervalRemoved(Ba
sicListUI.java:1071)
at javax.swing.AbstractListModel.fireIntervalRemoved
(AbstractListModel.java:140)
at javax.swing.DefaultComboBoxModel.removeAllElements
(DefaultComboBoxModel.java:167)
at javax.swing.JComboBox.removeAllItems(JComboBox.java:494)
.........


Sent via Deja.com http://www.deja.com/
Before you buy.

Holger von Thomsen

unread,
Aug 29, 2000, 3:00:00 AM8/29/00
to
In article <8ogg6r$8n1$1...@nnrp1.deja.com>,

li...@email.com wrote:
> I'm developing a SWING app in JBuilder 3.0. With the build-in JDK 1.2,
> when clearing content of the Combobox(at the very begining it is
> empty), I always get this problem. If switch to JDK 1.2.2, which is
> downloaded and installed separately, the app works just fine. But I
> have to stay with JDK 1.2 for a while. Anyone had same problem before?
> Any workaround to suggest?

First of all: Why do you need to stay with JDK 1.2?

Does this happen every time you clear the box, or only at start up?
Check if its emtpy before clearing it.
MB check the Interface ComboBoxModel (or something like this) for
building your own Model which you can assigne to and remove from the
box like you wish.

Hope this helps you.
If not I would call this a bug. Check
http://developer.java.sun.com/developer/ for Suns BugParade concerning
JDK bugs.

Regards,
Holger

0 new messages