Keyreleased method in keylistener class is getting called twice

Comments (3)

Ravi Chandra in Singapore, Singapore

97 months ago

i have created a simple dialog where i have a close button. When i give an escape.
The dialog should dispose.

The keylistener is registered with the dialog and the close button..

But when i am clicking escape, i found that the keyreleased methos is getting called twice... Why does it happen ???

Please help me..
thanks in advance...

Kirk Woll in Pleasanton, California

96 months ago

Check the keycode of the event. For me, one of them was KeyEvent.VK_ALT. You probably want to ignore the event in this case.

Germanboy in Steinau, Germany

79 months ago

If you regist the keylisterner with the Dialog and the button it's normal that the key released method is called twice.

i would only regist the keylistener with the dialog or the Button

» Sign in or create an account to comment on this topic.