On Fri, 27 Sep 2024 14:28:15 GMT, Alexey Ivanov <[email protected]> wrote:
>> If you call `.position(PassFailJFrame.Position.TOP_LEFT_CORNER)` after >> `.positionTestUIRightRow`, it is respected. > >> Should we provide a way to place instruction frame in arbitrary location on >> screen? > > You can do it by using the `InstructionUI` interface that's passed to you > when you implement a custom layout. > > We're still trying to encapsulate the frame that hosts the instructions… if > it's exposed, then the test developer can do whatever they want… yet then > they have to ensure calling methods on that frame from EDT. > > I'd rather not expose the frame at this time. > > How often does one need to position the instructions at an arbitrary location > on the screen? The `TOP_LEFT_CORNER` position is used by 6 tests only. With the instruction frame exposed, it would be possible to create owned modeless `JDialog` or `Dialog` instead of `JFrame` and `Frame` which has a great benefit: all the windows are brought to the top when you switch back to the test from another application. And there's only a single window on the taskbar for the test. I've been thinking about adding helper methods `createOwnedJDialog` and `createOwnedDialog` to cover this use case. Currently, it's possible to host test UI in a modeless dialog if you use `testUI` with `PanelCreator` that is pass a method which creates `JComponent`. I admit I like navigating the UI much easier in this case. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21207#discussion_r1778741079
