When i click near the line line gets selected but i want the line to be selected when exactly i click on the line not outside the line...I tried with the following code but line gets selected when i click outside, here mouseX and mouseY are the position where i click mouse;
so help please;
Line2D.Double ln = new Line2D.Double(xPos,yPos,xPos2,yPos2);
Code:boolean isSelected(double mouseX, double mouseY)
{
if (mouseX > (xPos - xPos2) && mouseX < (xPos + xPos2) &&
mouseY > (yPos - yPos2) && mouseY < (yPos + yPos2))
selected = true;
else
selected = false;
return selected;
}
