Java: Use keystroke with arrow key

后端 未结 2 580
醉酒成梦
醉酒成梦 2020-12-19 09:00

I have some code that I need to modify. In the code, the original author uses KeyStroke.getKeyStroke to take user input. In this code, for example, he uses

2条回答
  •  醉酒成梦
    2020-12-19 09:28

    You should be able to use KeyStroke.getKeyStroke("DOWN");, "UP", "LEFT", "RIGHT", to do what you want.

    See the javadoc for more detail.

提交回复
热议问题