On Wed, 26 Jun 2024 08:40:24 GMT, Abhishek Kumar <abhis...@openjdk.org> wrote:
>> 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. > > I tried moving the `repaintMnemonicsInWindow` and > `repaintMnemonicsInContainer` under `SwingUtilities` class but faced build > issue while accessing them in `WindowsPopupMenuUI` file. > > I will try with the suggested packages as you mentioned. The `javax.swing.SwingUtilities` is a public class, which means adding public methods to it requires a CSR; package-private methods aren't visible from other packages. The `sun.swing` and `com.sun.java.swing` packages aren't public, you can add public classes with public methods easily; since the classes are public and the methods are public, they're accessible from any other package in Swing. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/18992#discussion_r1654417685