action performed bug?

  • Thread starter Perica Milosevic
  • Start date
P

Perica Milosevic

While working with JButton class I experienced this problem:
The method ActionPerformed is executing twice instead of once like it
should normaly be.
I cannot find out the reason why it's happening. Anyone can help?
 
V

VisionSet

Perica Milosevic said:
While working with JButton class I experienced this problem:
The method ActionPerformed is executing twice instead of once like it
should normaly be.
I cannot find out the reason why it's happening. Anyone can help?

Make certain you aren't adding the listener twice.
 
P

Perica Milosevic

VisionSet said:
Make certain you aren't adding the listener twice.

Sorry, I didn't mention that it's not happening each time. Actually, there's
no rule if ActionPerform is executing once or twice. Normally, it's
executing once, but SOMETIMES, which is very rare, it's executing twice.
Therefore, I cannot find out what's actually going on...
 
M

Michael Borgwardt

Perica said:
Sorry, I didn't mention that it's not happening each time. Actually, there's
no rule if ActionPerform is executing once or twice. Normally, it's
executing once, but SOMETIMES, which is very rare, it's executing twice.
Therefore, I cannot find out what's actually going on...

Sounds like some sort of race condition. Very tough nut to crack...
 
I

Igor Buzatovic

Radis u JBuilderu, sa GUI editorom?
Provjeri da li dvaput dodajes listenera, kao sto je vec netko rakao... kad
si siguran da nije to , onda tek trazi dalje jer je to najcesci razlog ove
greske. A JBuilder zna dodati dvapit listenera ako radis sa GUI
dizajnerom...
 
R

Roedy Green

ActionPerformed is executing twice

there is debounce logic in your mouse driver. Do any other apps act
as if you had hit the button twice? If you hit the mouse tentatively
you might effectively hit it twice.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top