This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
I'm using a KeyListener interface and writing code for the three methods required. keyPressed() keyReleased() keyTyped() Can someone please explain to me why keyPressed() and keyReleased() seem to the be the only actions understood. The description of keyTyped sounds like when I type a key it should be invoked - but nothing is happening. Thanks for any help. Paul
Manfred Leonhardt
Ranch Hand
Joined: Jan 09, 2001
Posts: 1492
posted
0
Hi Paul, It depends on what source you are using for the KeyListener. The code below works for me under JDK1.2.
If I remember correctly the TextField has some "bug" in it that keyTyped doesn't get called for every keystroke. I think that is because the TextField intercepts the keys and only lets some of them through... Regards, Manfred.
Paul Keohan
Ranch Hand
Joined: Mar 15, 2000
Posts: 411
posted
0
It's actually a TextField I'm using so that probably explains the problem. I've managed to get working what I need to get working anyway. Thanks a lot. Paul