RFR: 8155030: The Menu Mnemonics are always displayed for GTK LAF [v8]

Alexey Ivanov aivanov at openjdk.org
Tue Jun 25 15:14:12 UTC 2024


On Mon, 24 Jun 2024 07:20:24 GMT, Abhishek Kumar <abhiscxk at openjdk.org> 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


More information about the client-libs-dev mailing list