Keyreleased method in keylistener class is getting called twice

Get new comments by email
You can cancel email alerts at anytime.
Comments (3)

Ravi Chandra in Singapore, Singapore

83 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...

- Was this comment helpful? Yes / No Reply - Report abuse

Kirk Woll in Pleasanton, California

82 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.

- Was this comment helpful? Yes / No Reply - Report abuse

Germanboy in Steinau, Germany

66 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

- Was this comment helpful? Yes (1) / No Reply - Report abuse

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