Move image using keyboard - Java

前端 未结 3 541
闹比i
闹比i 2020-12-21 01:49

I wanted to move my image using keyboard arrow keys. when I pressed the arrow keys it moves accordingly to the direction. However, I need to click on the image before able t

3条回答
  •  情深已故
    2020-12-21 02:25

    You have look at KeyBindings, otherwise you have to JComponent#setFocusable() that nest the Image, example for Moving Image

提交回复
热议问题