RFR: 8365625: Can't change accelerator colors in Windows L&F [v2]

Alexey Ivanov aivanov at openjdk.org
Thu Aug 21 20:55:41 UTC 2025


> **Problem:**
> 
> The colors for the accelerators are cached in static fields: `disabledForeground`, `acceleratorSelectionForeground` and `acceleratorForeground`. As soon as this field is set to a non-`UIResource` value, the value cannot change.
> 
> **Fix:**
> 
> Remove the static fields for accelerator from `WindowsMenuItemUI` and use the fields inherited from `BasicMenuItemUI`, pass these fields as parameters to static methods.
> 
> Additionally, I formatted the calls to `WindowsMenuItemUI.paintMenuItem` in one consistent way.
> 
> I removed the redundant javadoc from `paintMenuItem` and added the missing `@Override` annotation.
> 
> I provided a regression test. The test also reproduces [JDK-8365375](https://bugs.openjdk.org/browse/JDK-8365375) that was resolved in #26743.

Alexey Ivanov has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase.

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/26826/files
  - new: https://git.openjdk.org/jdk/pull/26826/files/d4286bcb..d4286bcb

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=26826&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26826&range=00-01

  Stats: 0 lines in 0 files changed: 0 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/26826.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26826/head:pull/26826

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


More information about the client-libs-dev mailing list