Click here to Skip to main content
15,743,429 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am writing an application that allows to add any shape select, change color of the shape, highlight the shape selected and delete a shapes. I have an abstract Shape class that contians two methods for drawing and moving shapes. Every Shape has it's own class which inherits from Shape class. I also created a interface that inherits from JFrame. Shapes will be drawn by drawing class which inherits from JPanel,MouseListener, MouseMotionListener, ActionListener...In Interface class when I click add shape button drawing class draw shapes based on shape class. I managed to move the shapes individually but i can't move them after clicking several shapes together..
Updated 17-Aug-15 20:29pm
Maciej Los 17-Aug-15 17:45pm    
What have you tried?
Member 10549871 17-Aug-15 21:05pm    
I created a separate class to handle multi selections where it stores point(x,y) of the shape selected and the Shape datatype to store the reference
Maciej Los 18-Aug-15 2:02am    
And... So, do i have guessing that you use graphic objects? Where do you draw them? How? Every detail is necessary to provide an answer. Please, improve you question. Use "Improve question" widget.

1 solution

You did not provide enough information.

If you have a reference to Shapes collection, you have to clear the collection then to repaint area where the shapes have been painted. For further information, please see: Clear Graphics Objects from Jpanel [^]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900