🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #18464

Re: ItemStateChanged fires twice?

#18464
From: Richard Wilkman
Date: Wed, 24 Jun 1998 00:00
77 lines
2976 bytes
Alex:

Well, remember that the most dangerous thing in the playground is the
Swingset <g>.  This one has nothing to do with Swing, but it gets
everyone eventually.

-Rich

Alex Humphreys wrote:
> 
> thanks, Rich, you're a helpful guy.  (I'm still getting the hang of swing,
> if you'll pardon the expression).
> 
> Richard Wilkman wrote:
> 
> > 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
> > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

-- 

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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: <359145CD.E4969420@inprise.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <358FD1C9.F07DEE56@sema4.com> <35902823.DC127EC0@inprise.com> <35911418.EE529E56@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/24
Message-ID: <359145CD.E4969420@inprise.com>
X-Deja-AN: 365722368
Content-Transfer-Encoding: 7bit
References: <358FD1C9.F07DEE56@sema4.com> <35902823.DC127EC0@inprise.com> <35911418.EE529E56@sema4.com>
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language