0

Hi,

I have a "Save" button with the following code

Save.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent evt) {

                k = k+1;
                System.out.println(k);
                }
            });

somehow, it is executing multiple times with single click on the button (k values is 4 at times). I googled it but couldn't find some helpful results. What should I do if I want to execute action performed only once?

thanks a lot

Edited by srikanth2321

2
Contributors
1
Reply
13
Views
4 Years
Discussion Span
Last Post by mKorbel
1

ActionListener is desingnated to runce only one time, from Mouse or Key Events, issue must be in rest of your code

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.