I just noticed a strange issue: I have a JTextField (testText) in my GUI, which registered a keyListener, when I popup a dialog in its keyReleased() function, pressing "enter" key on dialog causes keyReleased event on JTextField endlessly. However, it's ok using mouse clicking on "ok" on dialog. The same dialog works fine in keyPressed() function.
When above code running on jdk1.4.2, I pressed any key (ex. "Esc" or "Enter") key on that text field, this_keyReleased() is invoked, and a message dialog is popped up with focus on "OK" button on that dialog. So, when I pressed "Enter" key, for some reasons the keyReleased event is fired again and the same message dialog is popped up again, so, keeps pressing "Enter" key, keeps popping up the same dialog endlessly. However, moving this_keyRelease() from keyReleased() to keyPressed(), everything seems ok. So, could any one please give me some hints how does that happen? Is that from some focus issues? or is that a bug in jdk1.4.2?