I am slowly stepping into Java and trying out a program using Swing. I am trying out a program to use a single button to enter different letters. Each letter should be entered in the text box within 5 seconds.
I've tried using Handlers, but unfortunately I messed it up. What I am trying to achieve is that, when I tap the button once, Letter A should be entered and when pressed twice Letter B should be entered and thrice Letter C. Most importantly, time to enter each letter is 5 seconds. After 5 seconds, if the button is pressed once Letter A should be entered. Hope you understand my question.
How to use same button for different tasks with respect to time?