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
精彩评论