On Fri, 1 Mar 2024 10:22:16 GMT, Abhishek Kumar <abhis...@openjdk.org> wrote:

> > You could add @modules java.desktop/com.sun.java.swing.plaf.windows to 
> > jtreg tags and access the 
> > com.sun.java.swing.plaf.windows.WindowsLookAndFeel.isMnemonicHidden method 
> > to verify that the mnemonics are shown or hidden based on how many times 
> > you (the Robot) pressed F10 key as well as the menu bar is active or not.
> 
> How to check for menubar whether it is active or not? Should I check the 
> keyboard focus?

You have it in the code:


               MenuElement[] selectedPath = msm.getSelectedPath();
               if (selectedPath.length > 0 && (selectedPath[0] instanceof 
JMenuBar)) {

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

PR Comment: https://git.openjdk.org/jdk/pull/17961#issuecomment-1972951361

Reply via email to