On firing an event at a keyReleased or actionPerformed(button click).This event fires continuosly whenever I click.Say,for 10 clicks, 10 events are in queue.I want to clear remaining 9 events while first processing.

-thanks

Recommended Answers

All 3 Replies

I think when button clicked, a long process is started in your application and you dont want to get any clicks until it is finished?

Why dont you disable the button as soon as it clicked and re-enable it when the process finished.

+1 for the above. Understand what it is you want from the UI and then you can figure out the behavior in the code.

Usually, you respond to single button events--clicked (that's it). If you're getting multiple clicks in a short time, disable the button after the click until your processing is complete.

Thanks for the reply , chronless & gangsta. Actually ,I have done that.But , for better performance only ,i raise this ques. Anyway,
Thanks for the suggestion.

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.