Scanner scanner = new Scanner(System.in);
或者是
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
怎么才能接受到ctrl+ 某个键 或者是 alt + 某个键 或者是其它特殊键 谢谢!
------解决方案--------------------
CTRL+c就是^c
------解决方案--------------------
试试这个
- Java code
jTree1.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { if (evt.isControlDown() && evt.getKeyCode() == KeyEvent.VK_C) { JOptionPane.showMessageDialog(this, "ctrl + c"); } else if (evt.isControlDown() && evt.getKeyCode() == KeyEvent.VK_X) { JOptionPane.showMessageDialog(this, "ctrl + x"); } else if (evt.isControlDown() && evt.getKeyCode() == KeyEvent.VK_V) { JOptionPane.showMessageDialog(this, "ctrl + v"); } } });
------解决方案--------------------
http://topic.csdn.net/u/20110405/22/074afece-fbb1-4285-9e22-56513a3c22cf.html
希望对你有帮助! 顺便帮你顶一下!
------解决方案--------------------
能不能调试下看看你的System.in或那些对象中接收到了什么值