RFR: 8328242: Add a log area to the PassFailJFrame [v2]

Alexander Zvegintsev azvegint at openjdk.org
Fri Mar 15 15:24:39 UTC 2024


On Fri, 15 Mar 2024 15:02:27 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> I expected the label to be aligned to the left. For this to happen, the label may need to wrapped into another panel or horizontal box with added glue.
>> 
>> 
>> 
>>             Box logLabelBox = Box.createHorizontalBox();
>>             logLabelBox.add(new JLabel("Log:"));
>>             logLabelBox.add(Box.createHorizontalGlue());
>> 
>>             Box buttonsLogPanel = Box.createVerticalBox();
>>             buttonsLogPanel.add(buttonsPanel);
>>             buttonsLogPanel.add(logLabelBox);
>>             buttonsLogPanel.add(new JScrollPane(logArea));
>> 
>> 
>> ![Log Area with the "Log:" header, screenshot of PassFailJFrame](https://github.com/openjdk/jdk/assets/70774172/69a86152-a8a6-45ec-9a66-a457f4f5e396)
>> 
>> Placeholder text isn't supported by Swing natively, is it? Therefore, you'll have to remove the placeholder text when you add the first message, which complicates logging a message.
>
> It could be obvious from the usage… so we may skip the header altogether… if it's mentioned in the instructions, which should still be mentioned to let the test know they need to look for the messages.

> Placeholder text isn't supported by Swing natively, is it?  Therefore, you'll have to remove the placeholder text when you add the first message, which complicates logging a message.

It is not a big overhead, e.g. I already did it by slightly changing the `log()` method. `logClear()` and `logSet()` are untouched.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18319#discussion_r1526451001


More information about the client-libs-dev mailing list