RFR: 8367348: Enhance PassFailJFrame to support links in HTML [v3]

Alexey Ivanov aivanov at openjdk.org
Wed Sep 10 17:04:47 UTC 2025


On Wed, 10 Sep 2025 16:57:20 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> Add HTML link processing ability in instructions. For example:
>> 
>> PassFailJFrame.builder()
>>         .instructions(htmlWithLinks)
>>         .addHyperlinkListener(e -> {
>>             if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
>>                 performActionOnLink(e.getDescription());
>>             }
>>         })
>> 
>> I also take this chance to make a CSS change for fix-width text to show a light-gray background color.
>
> Weijun Wang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   the link

Changes requested by aivanov (Reviewer).

test/jdk/java/awt/regtesthelpers/PassFailJFrame.java line 103:

> 101:  * instructions are displayed as HTML, as supported by Swing, which
> 102:  * provides richer formatting options. {@link Builder#hyperlinkListener}
> 103:  * can be called to add a listener to hyperlinks inside the HTML.

Suggestion:

 * provides richer formatting options. To handle navigating links in the
 * instructions, call {@link Builder#hyperlinkListener} to install a listener.

test/jdk/java/awt/regtesthelpers/PassFailJFrame.java line 1491:

> 1489: 
> 1490:         /**
> 1491:          * Sets a {@link HyperlinkListener} for navigating links inside the instructions pane.

Suggestion:

         * Sets a {@link HyperlinkListener} for navigating links inside
         * the instructions pane.

We usually keep the lines shorter than 80 columns.

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

PR Review: https://git.openjdk.org/jdk/pull/27197#pullrequestreview-3207014958
PR Review Comment: https://git.openjdk.org/jdk/pull/27197#discussion_r2337362992
PR Review Comment: https://git.openjdk.org/jdk/pull/27197#discussion_r2337351149


More information about the client-libs-dev mailing list