I hava a project which will look like similar to Paint program. Here, I’m supposed to draw lines with start and end points and then I need to be able to move these lines by simply dragging my mouse on them.
I draw the lines using the drawLine method of Java. The problem is, I have no idea how to move these lines 🙁
Please help me if you have an idea on this,
Thanks.
You need to add some sort of ActionListener and detect when the user clicks a line on the screen. Then you need to monitor the mouse movement; and rePaint() the line.