I have a component that I want to move when someone moves a parent AWT frame. I want the component to seemlessly follow the frame, as if they were one. However, getting the location of the frame is not seemless, it's jerky. Adding a ComponentListener with a componentMoved also has this same jerky I moved, second later, I moved again. I want the position of the Frame to be updated every frame, instead of when I stop moving, so that I get the positions in between and can setLocation() on the other component.
Any way to get the accurate location through the entire move process so I don't get this jerky effect?
I get the issue with your code as well. The frames don't move in realtime together. If I grab the frame and wildly move it around the screen, the second frame doesn't move into position until I stop moving the first frame. I need both frames to move as one.
It's not on mouse release. It's when the frame stops moving. I can still have the mouse held, drag it some more. Each time I stop, the other frame will jump to position. If I spin the frame in circles, the second frame just sits there, until I stop, then jumps to position. Weird
Joined: Jun 13, 2009
So why didn't you post you JDK version and platform???
Maybe someone else who has the same setup will test your code to see if they have the same problem or can provide a solution.
Must be going blind, I missed the platform comment.
Seems I'm not the only one, but I haven't seen a fix, though some suggested trying to capture mouseDragged. Guess it's been an issue on the Mac for a while, seems to be reported as "regression bug, 7731968", though I can't check it.