I currently have a situation where i am using the mouse to drag a window(not a frame) but one if the problems that i am facing is how to obtain the shift in the mouse drag. By that i mean whether the mouse moved up/down a pixel, or sideways a pixel. Because i cannot find a good smooth way to move the window. right now in mouseDragged(MouseEvent e) i use a line of code that goes like:
but this can hardly be called good. Do you know something here that will help me really move the window in a good mathematically appropriate way.
Also, I have one more issue. When i click on the panel and drag it i fing that the cursor has a tendency to move to the top left corner and not stay at the point where it was clicked first. Maybe you can help me set this right too.
Thanks in advance,