File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

actionPerformed() called twice

 
Emili Calonge
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1780
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps you're calling addActionListener again elsewhere.
 
Emili Calonge
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep, I hate me so much when I do this things with copy paste. Thanks.
 
leon liu
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.......
 
Emili Calonge
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic