Click to See Complete Forum and Search --> : Capturing Tab-cycle


mdenis
August 12th, 1999, 09:01 AM
How do I capture key events associated with pressing Tab key ?

varbsjava
August 13th, 1999, 06:12 AM
Check for KeyEvent.getKeyCode() method returns a int value equal to KeyEvent.VK_TAB.
Then that event is from the TAB key.
But in JTextField u won't get the event thrown to your Listeners.Because the processKeyEvent catches it and then do the necessary action in the field and won't send this to the listeners.
So if u want to othere processing than the default one provided with swing then u have to overide the processKeyEvent(KeyEvent) method of the component.

Hope this will solve yours.
regards,
arun...