Re: Problem with overlapping custom componets



On 2007-11-14, L I M <clgoh@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
[snip]
Unless, if you've tried running the code, the user is given an
impression that
the lines are indeed non-overlapping, only the rectagle borders are.
Simply put it, the drawings of the rectagle borders had not covered
that part of the blue line, since the rectangle is transparent. But
the event is still consumed by the rectangle instead of the line
underneath it, since the rectangular object is still on top of that
line.

If that is the problem, then a boolean contains(int x, int y) method
should be added to the Line class. A return value of true indicates
that the component should receive mouse events when the mouse is at
location (x,y) of the component.
.