function document.onkeydown() { var keycode=event.keyCode; if(keycode==13) { //你要执行的操作 } }
添加监听ActionListener,在事件中调用transferForcus就可以了