java捕捉键盘事件(JButton)

jButton.addKeyListener(new KeyListener(){ public void keyTyped(KeyEvent e){} public void keyPressed(KeyEvent e){txt.setText("键被按下");} public void keyReleased(KeyEvent e){txt.setText("键被释放");} });
展开阅读全文

没有更多推荐了,返回首页