views:

13

answers:

1

I would implement the view moving, I just need to know if the mouse is offscreen (offwindow) and adjust the offset variables accordingly.

A: 

Maybe you can use a MouseListener to listen for the mouseExited event. Then you can use the MouseInfo class to get the current location of the mouse and then reset the location of the window accordingly.

If the mouse is moving too fast, the mouse may still be outside the window after you reset the location so maybe you will need to start a Timer to continually check the MouseInfo to get the current mouse location and then continually adjust the window location. If at any time a mouseEntered event is generated then you can stop the Timer.

camickr