Test seems to still fail in CI in ubuntu22.04 intermittently even after [JDK-8346324](https://bugs.openjdk.org/browse/JDK-8346324). Made the test headless similar to javax/swing/JScrollBar/bug4842792.java.
------------- Commit messages: - 8346828: javax/swing/JScrollBar/4865918/bug4865918.java still fails in CI - 8346828: javax/swing/JScrollBar/4865918/bug4865918.java still fails in CI Changes: https://git.openjdk.org/jdk/pull/22937/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22937&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8346828 Stats: 30 lines in 1 file changed: 1 ins; 20 del; 9 mod Patch: https://git.openjdk.org/jdk/pull/22937.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22937/head:pull/22937 PR: https://git.openjdk.org/jdk/pull/22937