Using SwingUtilities.isRightMouseButton fixes button mix-up.
Right-click and clicking again on the first selected node stops creating edges.