I don't quite understand the parameters the timer constructor expects
timer(int, actionListener) <-- how would it be possible to hook up an actionListener to a keyPressed method.
Ive tried putting KeyEvent e or just e but this does not work.
Could somebody please reply with an example scenario of how to use a timer on key Pressed.
It's important that I understand how to do this as it is an common practice working with timed events.
Thankyou.
timer(int, actionListener) <-- how would it be possible to hook up an actionListener to a keyPressed method.
Ive tried putting KeyEvent e or just e but this does not work.
Could somebody please reply with an example scenario of how to use a timer on key Pressed.
It's important that I understand how to do this as it is an common practice working with timed events.
Thankyou.