2
如何在java swing中輸入JButton的關鍵焦點?在java swing中輸入JButton的關鍵焦點?
我已經做過這樣的
btn_Login.registerKeyboardAction(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println("enter key pressed");
}
}, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0,false), txt_Username.WHEN_FOCUSED);
但不工作
請參閱此鏈接http://www.devx.com/DevX/Tip/31605 – Hukam 2010-09-03 09:58:17