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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.