RFR: 8350260: Improve HTML instruction formatting in PassFailJFrame

Alexey Ivanov aivanov at openjdk.org
Tue Feb 18 11:52:22 UTC 2025


**Problem:**

When instructions are long, the formatting in `PassFailJFrame` looks off:

1. When the instructions are displayed on the screen for the first time, the HTML is scrolled to the bottom, which isn't convenient;
2. Numbers above 10 in the list are clipped on the left;
3. No border around the HTML text.

These problems were found while converting the instructions for `test/jdk/javax/accessibility/TestJCheckBoxToggleAccessibility.java` in https://github.com/openjdk/jdk/pull/23436.

<details>
<summary>Screenshots of the instructions</summary>
The instructions are scrolled to the bottom when the test starts:  
![01-instructions-bottom](https://github.com/user-attachments/assets/66c8d319-83d7-4219-91a5-96c964b9a0fe)

The number 10 in the list is clipped on the left:  
![02-clipped-numbering](https://github.com/user-attachments/assets/8db421ff-7b91-4db8-988c-03828097890e)

The headings _“Testing with…”_ are flushed to the left, there's no additional space between the scroll pane border and the text.
</details>

**Fix:**

1. Adjust the list margins to accommodate for longer text;
2. Install the text border to either text instruction component;
3. Scroll the text to the top.

<details>
<summary>Screenshot of the instructions <i>with the fix</i></summary>
The stated issues are resolved:  
![03-top-no-clipping](https://github.com/user-attachments/assets/d14cfae2-733d-468d-93b9-c93d2d00cb3c)
</details>

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

Commit messages:
 - 8350260: Improve HTML instruction formatting in PassFailJFrame

Changes: https://git.openjdk.org/jdk/pull/23674/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23674&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8350260
  Stats: 7 lines in 1 file changed: 2 ins; 1 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/23674.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23674/head:pull/23674

PR: https://git.openjdk.org/jdk/pull/23674


More information about the client-libs-dev mailing list