What could be happening is that, each time you try to put down a point, thePath2D
just adds on a new path to the existing path. What you may have to do is get the program to create a new Path2D
each time you click. Then again, this creates a bunch of Path2D
nodes which aren't connected. So you may have to somehow put all of these new Path2D
s together.
Hope that helps.