Article View: borland.public.jbuilder.java.language
Article #18459Re: ItemStateChanged fires twice?
From: Richard Wilkman
Date: Tue, 23 Jun 1998 00:00
Date: Tue, 23 Jun 1998 00:00
47 lines
1924 bytes
1924 bytes
Alex:
That's exactly what it's supposed to do. You get one for the item
that is getting de-selected (it's state changed) and one for the item
getting selected (it's state changed). You need to do your own
filtering in your events so that your code executes only when you want
it to. Something like:
void choiceChanged(ItemEvent e){
if(e.getStateChange() == ItemEvent.SELECTED){
// do whatever
}
}
-Rich
Alex Humphreys wrote:
>
> I have a JdbComboBox with an ItemStateChanged event. Problem is that
> when I choose an option in the comboBox, it fires the ItemStateChanged
> event TWICE. It runs all the way through it once, and then goes into
> some jdbComboBox code and then the event gets fired again. What's
> happening? This didn't happen before I was using Swing.
>
> Any ideas? I can provide code if that would be helpful....
>
> Thanks.
>
> Alex
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Rich Wilkman
Senior Quality Assurance Engineer
Borland JBuilder Team
If you see something that looks like an opinion up there,
it's mine and mine alone.
Mail sent to me from the newsgroups won't bounce but will
be ignored. If I have time, I'll respond, but you have
a better chance if you confine your posts to the newsgroups
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Technical Details
Message-ID:
<35902823.DC127EC0@inprise.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<358FD1C9.F07DEE56@sema4.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,2937d74bbbd3557f X-Google-Attributes: gidf74b3,public From: Richard Wilkman <rwilkman@inprise.com> Subject: Re: ItemStateChanged fires twice? Date: 1998/06/23 Message-ID: <35902823.DC127EC0@inprise.com> X-Deja-AN: 365450129 Content-Transfer-Encoding: 7bit References: <358FD1C9.F07DEE56@sema4.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.language