On Tue, 23 Aug 2022 14:44:24 GMT, Alexey Ivanov <[email protected]> wrote:
>> test/jdk/java/awt/regtesthelpers/PassFailJFrame.java line 268:
>>
>>> 266: * is null, only the instruction frame is positioned according to
>>> 267: * {@code position} parameter. This method should be called before
>>> making
>>> 268: * the test window visible.
>>
>> Since this condition is documented, should we also implement check to handle
>> it by calling isShowing() and throw some warning/exception if its visible.
>> We do the opposite for getLocationOnScreen() where we throw exception if the
>> compoment is not showing.
>
>> Since this condition is documented, should we also implement check to handle
>> it by calling isShowing() and throw some warning/exception if its visible.
>> We do the opposite for getLocationOnScreen() where we throw exception if the
>> compoment is not showing.
>
> It's more like a recommendation rather than a requirement. It is to avoid
> flickering when the window gets displayed for a very short period of time at
> its default position before being moved to its final position.
>
> The same had happened to the instruction frame before Harshitha moved
> `setVisible(true)`.
Yes, as described by @aivanov-jdk ,this was added to avoid flickering (happens
when windows move from the initial to the final position).
-------------
PR: https://git.openjdk.org/jdk/pull/9525