title: Connect two circles with a line
body: <p>I'm drawing two shapes (circles) in a JPanel and I need to connect them with a line. I was doing this by just getting the middle point of the circle and connecting each other, easy.</p>
  
  <p>The problem is that now I need to make single-direction lines, which has an "arrow" at the end, to point out which direction the line goes. So now I can't use the middle point of the circle because I need to connect each other from border to border, so the "arrow' can appear correctly.</p>
  
  <p>On my last try that was the result, nothing good: </p>
  
  <p><img src="https://i.stack.imgur.com/KO02b.png"></p>
  
  <p>PS: In the screenshot I'm not filling the circles just to see the exact position of the line, but normally I would fill it.</p>
  
  <p>I'm having trouble to calculate the exact position of the border I need to start/end my line. Anyone has any idea on how to do this?</p>
  
  <p>EDIT: The circles are movable, they could be in any position, so the line should work in any case.</p>