Results 1 to 2 of 2
Thread: moving an object
- 10-23-2010, 08:54 PM #1Member
- Join Date
- Dec 2009
- Rep Power
moving an object
I am wodering how you would go about taking an object, such as a circle,
and making it move, as if leftarrow is pressed then it moves to the left by 2 pixels.
The one way i know how to do this is to use draw, and everytime the button is presed, it redraws it 2 pixels, and to keep it from having the other drawings before it, i made a rectangle the size of the screen to redraw it each time it executes so it gets rid of the ones before.
I realized this isnt a very good way and would not work well with more advanced applications.
IS there a way to move it around in a better way?
- 10-23-2010, 09:34 PM #2to keep it from having the other drawings before it, i made a rectangle the size of the screen to redraw it each time it executes so it gets rid of the ones before.
- By macwadu in forum AWT / SwingReplies: 12Last Post: 07-01-2010, 11:18 PM
- By rsjava24 in forum AWT / SwingReplies: 1Last Post: 02-26-2010, 11:47 AM
- By dotabyss in forum Java 2DReplies: 1Last Post: 02-17-2010, 12:20 AM
- By anilanar in forum New To JavaReplies: 2Last Post: 08-30-2009, 12:29 PM
- By GabWit in forum New To JavaReplies: 2Last Post: 01-26-2009, 05:07 PM