I’m hoping this is an easy question to answer. I am getting the mouse location via:
one1 = e.getX();
one2 = e.getY();
And I do this twice to get both the start and the end of the line, but when the line is drawn the coordinates are a good bit off. I haven’t resized the window or anything?
g2d.drawLine(one1, one2, two1, two2);
Is there something extra I need to check or adjust before drawing the line?
Got this sorted now, the comment that pointed out was the listener on the parent frame or the actual canvas. This was part of the problem, but also changing
to:
I don’t really know why that makes a difference but it did.