RFR: 8315986: javax/swing/JMenuItem/4654927/bug4654927.java: component must be showing on the screen to determine its location [v4]
Alexey Ivanov
aivanov at openjdk.org
Thu Oct 5 15:27:10 UTC 2023
On Thu, 5 Oct 2023 15:15:24 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
> But 1st case uses center coordinates via Util.getCenterPoint whereas 2nd case uses getLocationOnScreen+10 so it's not exactly the same.
Yes, they're somewhat different. Yet the centre is safer (what if `getLocationOnScreen+10` is out of menu bounds?), it doesn't change the test logic.
> I guess we can do away with Util class and make it use SwingUtilities.invokeAndWait but I guess we can do it at later point..
It's possible… yet I don't see much value in doing so, the `Util` class does it job… and avoids duplicating code.
However, `glide` method doesn't provide a smooth glide: with its 10-pixel step, the mouse is moved from the "Menu" to the greyed out item in just two steps. It's still a drag yet I expected smoother movement.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15677#discussion_r1347606918
More information about the client-libs-dev
mailing list