i dont how to solve this problem. I am developing a graphical editor, where arc(line) drawing is possible. I manually set the size of arc component to 1000x1000, so i dont have to change it when this arc will be dragged & dropped. Then i paint into this component the arc of the desired dimensions. Every arc components have mouse listener installed. The problem is, that only the most upper arc component get the mouse message. Also i have a mouse click listener installed on the JPane itself, but the mouse click listener on the most upper component simply gets all the events...It is kinda hard to describe this problem, so i will provide you with the simple image
So the first solution is to somehow forward the received message to the component that lies under, however i dont know how to do this, so do you have any ideas ?
The second solution is, not to set constant dimenstion to the arc object, but somehow rotate the rectangle in which that arc will be, i mean it like this.
however, there still can be the overlapping problem.
So, do you have any ideas how to solve this problem ? or if you have any other ideas, how to solve this, id be happy, i simply need that the correct arc will react to the mouse click.
I dont think that the my code will somehow helps, but here it is
arcObject.setSize(1000, 1000); // !
and then, in this component i draw an arc
toX = o2.x - 24 * Math.cos(theta);
toY = o2.y - 24 * Math.sin(theta);
g2.draw(new Line2D.Double(toX, toY, o1.x, o1.y));