Possible Duplicate:
MouseListener needs to interact with many object Java
I have a program with many images drawn onto the screen, as well as other things. I have a mouse listener, but what is the most efficient way of detecting what has been clicked on the screen? Because if I have an image 100px x 50px
@ starting at point 500, 300
,
I can't say if (x > 500 && x < 600)
etc.. for EVERY image on screen?
Thank you for any help