Article View: borland.public.jbuilder.java.swing
Article #10634JComboBox problem.
From: Timothy Reaves
Date: Mon, 23 Aug 1999 00:00
Date: Mon, 23 Aug 1999 00:00
28 lines
1908 bytes
1908 bytes
I use many JComboBoxes to display Vectors of objects. I create all
of them the same way:
jCombo.setModel(new DefaultComboBoxModel(myVector));
This works very well except for one instance. In this instance - where
ever I use this particular Vector - when I select an object from the
JCombo I get an exception. Now mind, I'm not attaching anything to the
JCombo that does anything. This is an ordinary JCombo with no attached
action listeners or anything.
The first section below is the actual exception and stack, and the
second section is when the stack is finally finished and I regain
control of the app. When this happens, the JCombo looks normal, except
that my selection is not selected.
One more piece of information: if I first add something to the
JCombo (these are on data entry forms) by setting the model, then
changeing to a new model (of the same Vector just with an added
element), then try to select something from the JCombo, I NEVER regain
control of the app. It prints out the same exception but then hangs.
Odd.
Exception occurred during event dispatching:
java.lang.StackOverflowError
at java.lang.ref.Finalizer.register(Finalizer.java:79)
at javax.swing.JComboBox.selectedItemChanged(JComboBox.java:667)
at javax.swing.JComboBox.contentsChanged(JComboBox.java:730)
at
javax.swing.AbstractListModel.fireContentsChanged(AbstractListModel.java:82)
Technical Details
Message-ID:
<37C1B5EE.1ECCDE51@silverfields.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,d0aca1e7902612c5,start X-Google-Attributes: gid111d45,public From: Timothy Reaves <treaves@silverfields.com> Subject: JComboBox problem. Date: 1999/08/23 Message-ID: <37C1B5EE.1ECCDE51@silverfields.com> X-Deja-AN: 516315448 Content-Transfer-Encoding: 7bit Organization: Silverfields X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing