Article View: borland.public.jbuilder.java.swing
Article #12878JComboBox bugs
From: Alberto Robles
Date: Thu, 29 Oct 1998 00:00
Date: Thu, 29 Oct 1998 00:00
57 lines
2326 bytes
2326 bytes
Nigel Fletton wrote:
Hello Nigel,
I'm doing just the same as you did, but with 250 items, and it works
fine for me, at least referring to time performance. Instead I've got
problems with refreshing the component itself:
- Old Items does not disappear from the combo.
- Drop down arrow disappears (but you can still selecting items using
cursor keys).
- and, sometimes, the Combo sticks to the menu component in my
application.
Here is my code:
infoProj=control.projUser(user);
String projects[] = new String[infoProj.length];
jComboBox1.removeAll();
for(int i=0;i<infoProj.length;i++) {
projects[i]=infoProj[i].IDProject + " - " + infoProj[i].Name;
jComboBox1.addItem(projects[i]);
}
I've also notice another bug. When the Combo is selected, the JBuilder
menu component goes crazy making impossible to select any option.
Alberto.
>
> Any ideas on why the addItem call in the example code below is very slow
> when rebuilding the content of a JComboBox?
>
> The vector typically contains around 50 Strings. On the application this
> code sample comes from, there are several similar combo boxes on a
> tabbed form that result in the form being very slow to rebuild when new
> data is loaded.
>
> Vector v;
> .......
> String strExample;
> combo.removeAllItems();
>
> e = v.elements();
> while(e.hasMoreElements()) {
> strExample = e.nextElement().toString();
> combo.addItem(strCompItem);
> }
>
> Nigel
--
--------------------------------------------------------------------
Alberto Robles | Contrary to popular belief, Unix is user friendly.
Tecsidel,S.A. | It just happens to be selective about who it makes
+34-93-2922110 | friends with.
Technical Details
Message-ID:
<36384429.46DEB39E@tecsidel.es>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3635DEFB.9C533C93@bt.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,f8cf4a252f41cfb9 X-Google-Attributes: gid111d45,public From: Alberto Robles <alberto.robles@tecsidel.es> Subject: JComboBox bugs Date: 1998/10/29 Message-ID: <36384429.46DEB39E@tecsidel.es> X-Deja-AN: 406267578 Content-Transfer-Encoding: 7bit References: <3635DEFB.9C533C93@bt.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: TECSIDEL Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing