How do I get the X and Y location of an image in a JScrollPane
I am trying to make a Map Editor for a 2D RPG, and what I currently am trying to do (to place tiles on the ground) is to have a JScrollPane with a JLabel (that has an image in it) and a Mouse Listener attached to the JScrollPane to determine the X and Y location of the image. The problem I run into is that it doesn't get the Images X and Y location but the JScrollPanes X and Y location. So I have a JScrollPane attached to an Image that is 512x4928, I attached a mouse listener to it. the problem resides when I try to get the Y location, since JScrollPane is a separate object it gets the X and Y