On Fri, 27 Sep 2024 14:53:21 GMT, Alexey Ivanov <[email protected]> wrote:

>>> You can do it by using the InstructionUI interface that's passed to you 
>>> when you implement a custom layout.
>> 
>> But it cannot be combined with the newly added methods like:
>> 
>> 
>>         PassFailJFrame.builder()
>>                 .instructions(INSTRUCTIONS)
>>                 .rows(15)
>>                 .columns(30)
>>                 .testUI(() -> WindowCreator.createTestWindows(3))
>>                 .positionTestUI((testWindows, instructionUI) -> 
>> instructionUI.setLocation(200, 200))
>>                 // or add a new method like
>>                 //.instructionFrameLocation(200, 200)
>>                 .positionTestUIRightRow()
>>                 .build()
>>                 .awaitAndCheck();
>> 
>> 
>> The idea is to make it very simple without having to implement the 
>> `positionTestUI` interface (I am not talking about exposing the frame, see 
>> the snippet above).
>> Like place the instruction frame here, and layout other windows relative to 
>> it.
>> 
>> But I agree it is a rare case.
>
> No, not directly.
> 
> But you can combine it with explicit call to `WindowLayouts`:
> 
> 
> .positionTestUI((testWindows, instructionUI) -> {
>     instructionUI.setLocation(200, 200);
>     WindowLayouts.rightOneRow(testWindows, instructionUI);
> })
> 
> 
> So, this (rare) scenario still doesn't require you to reimplement everything.

Oh, I hadn't paid attention to the fact that these methods are public. I guess 
it is a good solution to my request.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21207#discussion_r1778758261

Reply via email to