how can i use moveTo function to move a rectangle in swing ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

how can i use moveTo function to move a rectangle in swing ?

14th Mar 2017, 6:30 PM
Somnath Ghosh
Somnath Ghosh - avatar
1 Answer
+ 12
You need to repaint/draw the shape after assigning the new position by the moveTo method. General example for moveTo: http://www.java2s.com/Code/Java/2D-Graphics-GUI/GeneralPath.htm
14th Mar 2017, 8:16 PM
Tashi N
Tashi N - avatar