aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes actionPerformed() called twice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "actionPerformed() called twice" Watch "actionPerformed() called twice" New topic
Author

actionPerformed() called twice

Emili Calonge
Ranch Hand

Joined: May 17, 2003
Posts: 84
I've got a problem with a button in my program that calls the actionPerformed() twice (at least I think so) the code is this:


If I debug this code with the eclipse debugger I can see that it is entering the actionperformed function twice. I don't understand what's happening as I have other buttons with the same exact code (except the action commands) and they work perfectly. Hope anyone can help me. Thanks.
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
Perhaps you're calling addActionListener again elsewhere.


There is no emoticon for what I am feeling!
Emili Calonge
Ranch Hand

Joined: May 17, 2003
Posts: 84
Yep, I hate me so much when I do this things with copy paste. Thanks.
leon liu
Greenhorn

Joined: Jan 10, 2005
Posts: 3
In fact,Your code exactly call the actionListener twice,Maybe you can
print the message on your console,why the button had been active twice.......


My English is poor,so if my grammar is wrong.plz tell me tks..
Emili Calonge
Ranch Hand

Joined: May 17, 2003
Posts: 84
The error was that I had another button with the same action command. I don't see why you say that this code is calling actionlistener twice.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: actionPerformed() called twice