i have a small program that simply displays a jpg and i want it to draw a "point" when the mouse is first clicked. Then a second point when the mouse is clicked again and then also draws a line between them.

I will also want to be able to move theses points once they have been painted. What do i use??

I have been looking at Points2D but i dont understand how to initialze them.

Points2D p = new Points2D() wont work. I think ideally i will have to enter each mouse click into an array but how do i do that?