🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #803

Re: Action performed event handler fires twice

#803
From: Ed
Date: Wed, 14 Jul 2004 14:27
33 lines
2096 bytes
Ive had a similar problem before...i found that the problem was that the
action performed handler was recognising the button push as a action and the
button release as action so when the button was pushed in, it ran the code
and when the button was released it ran it again.

i changed to mousePressed for the button and it solved the problem, dont
know if its the same for you, but try it anyway!
Goodluck
"leov" <leov@emailaccount.com> wrote in message
news:2kfiblF1o5g8U1@uni-berlin.de...
> BrianW wrote:
>
>
> > The problem is that the event handler is being called twice, so the text
> > ends up in the text area twice. I read somewhere that it may be because
the
> > event handler doesn't register completion until the input stream has
closed,
> > so that the next time it checks for events, it hasn't been satisfied yet
and
> > gets fired again.
>
> Right, because the ListSelectionEvent from the JComboBox fires twice,
> first time for unselecting, second time for selecting the new item.
> You can select just one by using the getValueIsAdjusting() method of the
> event e.g.
>
> doSomething(ListSelectionEvent e)
> {
>      if (!e.getValueIsAdjusting()) justDoThatThing();
> }
>
> leo
Technical Details
Message-ID: <40f541fa@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <2k2icaF16gj6pU1@uni-berlin.de> <2kfiblF1o5g8U1@uni-berlin.de>

Show Full Headers
Complete Article Headers
X-Google-Thread: 111d45,11c992ff0658e7ea
X-Google-Attributes: gid111d45,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Ed" <edw@nupay.co.za>
Newsgroups: borland.public.jbuilder.java.swing
References: <2k2icaF16gj6pU1@uni-berlin.de> <2kfiblF1o5g8U1@uni-berlin.de>
Subject: Re: Action performed event handler fires twice
Date: Wed, 14 Jul 2004 16:27:34 +0200
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 196.23.156.52
Message-ID: <40f541fa@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1089815034 196.23.156.52 (14 Jul 2004 07:23:54 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail