Java KeyEvent square movement
问题 I have a piece of code in which a KeyEvent is triggered when any of the arrow keys are pressed. This in turn causes a square to move across the screen. Now I've noticed that when I press and hold the key, the square moves but the time after the initial movement to the subsequent movements is quite long if you understand what I mean? How would I go about diminishing this time? Thanks! import java.awt.*; import javax.swing.*; import squarequest.sprites.*; import java.awt.event.*; public class