开发者

Java/AWT/Swing: how to distinguish the pressed enter or return key

It looks like native applications behave differently if the user presses the Return key (right to the characters) or the Enter key (number key pad) - one time a new line character is inserted, the 开发者_C百科other time the default button is activated.

How I can distinguish both key presses from Java/AWT/Swing?


keyEvent.getKeyLocation() == KeyEvent.KEY_LOCATION_NUMPAD
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜