jButton.addKeyListener(new KeyListener(){ public void keyTyped(KeyEvent e){} public void keyPressed(KeyEvent e){txt.setText("键被按下");} public void keyReleased(KeyEvent e){txt.setText("键被释放");} });
java捕捉键盘事件(JButton)
最新推荐文章于 2024-05-22 10:00:47 发布