Java ImageIcons and actioin listeners
I am creating a simple game where a person clicks on an image the score increases by one. It seems simple enough, right? Here's the catch-- the images will be hidden partially behind other images! Currently, I'm using several imageIcons to set up my scene. For instance, my foreground has an image "foreground.png," my background is "background.png", and my image that is hiding between the two is "hiding.png". My first thought was to simply get the coordinates of the imageIcon hiding, add the height() and width() to them, and create a mouse listener that would only work in that specified region.