Mouseover with continuous updating?
I am currently working on a simple swing application which requires shifting the coordinates of an image. This shifting is supposed to occur whenever the mouse if over a rectangle placed near the edges of the screen. If you have played any RTS games such as Starcraft, C&C, or Warcraft 3, it is similar to their shifting movement. Currently, I can only think of writing a loop which constantly checks if the mouse is inside this rectangle, and if so, add some integer to the locations of the image. I feel this is not a proper way to use swing, so...
What is the proper way of doing this with Swing? I can't seem to find any listeners which would constantly be called when the mouse is over something. mouseMoved is the only event I could find that gave me decent results, but the image stops moving when my mouse does; I need it to continue to shift.