title: Java Path2D.Double on JPanel are painted with a 'tail'
body: <p>I have a strange behaviour when drawing a Path2D on a JPanel. 
  <BR/><BR/><BR/>
  Some of the shapes get kind of a tail as you can see on this screenshot:</p>
  
  <p><img src="https://i.stack.imgur.com/HGchS.png" alt="enter image description here"></p>
  
  <p>When I change the type to Line2D.Double, it is as I'd expect it:</p>
  
  <p><img src="https://i.stack.imgur.com/nT8XD.png" alt="enter image description here"></p>
  
  <p>Here's the code that draws the path / line:</p>
  
  <pre><code>Path2D.Double path = new Path2D.Double();
  Graphics2D g = (Graphics2D)this.getGraphics();
  for(int i=0; i&lt;geom.size(); i++)
  {
      double x = ddGeom.getX(geom.get(i));
      double y = ddGeom.getY(geom.get(i));
      if(i==0)
          path.moveTo(x-draw_center.x, y-draw_center.y);
      path.lineTo(x-draw_center.x, y-draw_center.y);
  }
  g.draw(path);
  </code></pre>
  
  <p><BR/></p>
  
  <p>Do you have an idea where the 'tails' in Screenshot1 come from? I use SDK Version 6.</p>
  
  <p>Thank you very much for your help</p>
  
  <p><BR/><BR/><BR/>
  Edit: When changing the code snippet to</p>
  
  <pre><code>if(i==0)
       path.moveTo(x-draw_center.x, y-draw_center.y);
  else
       path.lineTo(x-draw_center.x, y-draw_center.y);
  </code></pre>
  
  <p>most (maybe 75%) of the tails disappear. Any idea why this happens?</p>