Article View: borland.public.jbuilder.java.swing
Article #10794Re: RemoveAllItems in a combobox and adding new items
From: Marcel van den Dungen
Date: Wed, 11 Aug 1999 00:00
Date: Wed, 11 Aug 1999 00:00
26 lines
1177 bytes
1177 bytes
for some reason it must be something like this:
if (jCombobox.getItemCount() > 0)
{
jCombobox.removeAllItems();
}
jCombobox.addItem(newItem);
Chitra Amarnath wrote:
> Hi
>
> I am trying to refresh a combobox in a frame whenever the user clicks a
> button.
> Basically I am trying to removeallitems and add the new items when
> loading the frame containing the combo box. The code which I am using is
> jCombobox.removeAllItems();
> jComboBox.addItem(newItem);
>
> But for some reason I am getting an error in the console.
>
> I would really appreciate any help.
>
> Thanks in advance.
> Chitra
Technical Details
Message-ID:
<37B11E25.163EE3F4@c-content.nl>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<37AF39DF.C77AE936@enterpriseworks.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,cfb030f8a85e8b87 X-Google-Attributes: gid111d45,public From: Marcel van den Dungen <info@c-content.nl> Subject: Re: RemoveAllItems in a combobox and adding new items Date: 1999/08/11 Message-ID: <37B11E25.163EE3F4@c-content.nl> X-Deja-AN: 511359552 Content-Transfer-Encoding: 7bit References: <37AF39DF.C77AE936@enterpriseworks.com> Organization: C-CONTENT b.v. Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing