Hi, im trying to move an object that moves only with the user input. For example if i type in 45, it will move 45 spaces. How would I go about doing that?
Thank you for your time.
Hi, im trying to move an object that moves only with the user input. For example if i type in 45, it will move 45 spaces. How would I go about doing that?
Thank you for your time.
Simple way: create the object as a JLabel with an ImageIcon. Put it in a JFrame. In response to keyboard input use the JLabel's setLocation method to move it.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.