java如何写按钮事件?
操作方法
- 01
//实现键盘监听 public void keyPressed(KeyEvent e){ int keyCode=e.getKeyCode(); switch(keyCode){ case KeyEvent.VK_LEFT: //键盘左键 break; case KeyEvent.VK_UP: //上 break;
赞 (0)
//实现键盘监听 public void keyPressed(KeyEvent e){ int keyCode=e.getKeyCode(); switch(keyCode){ case KeyEvent.VK_LEFT: //键盘左键 break; case KeyEvent.VK_UP: //上 break;