On Mon, 24 Jun 2024 07:20:24 GMT, Abhishek Kumar <[email protected]> wrote:
>> src/java.desktop/share/classes/javax/swing/plaf/synth/SynthGraphicsUtils.java
>> line 751:
>>
>>> 749: * Repaints all the components with the mnemonics in the given
>>> window and all its owned windows.
>>> 750: */
>>> 751: static void repaintMnemonicsInWindow(final Window w) {
>>
>> The `repaintMnemonicsInWindow` and `repaintMnemonicsInContainer` are exactly
>> the same as methods in `WindowsGraphicsUtils`. And `AquaMnemonicHandler` has
>> yet another copy of the same code.
>>
>> Is it possible to move these methods to a utility class that's available for
>> all Look-and-Feels to avoid duplicating code?
>
> I will check and update if it is possible.
Thank you for looking into it. A `MnemonicHandler` class in `sun.swing` or
`sun.swing.plaf` package could be a good candidate. The `sun.swing` package
contains a lot of support classes for Swing, including `SwingUtilities2` and
`UIAction`; the `sun.swing.plaf` may be better as the mnemonic handler is part
of PLAF.
Another option is the `com.sun.java.swing` package which currently contains
`SwingUtilities3` and `plaf` subpackage with `gtk` and `motif` related classes.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18992#discussion_r1653017112