private static boolean hasMnemonic( Component c ) {
		if( c instanceof JLabel && ((JLabel)c).getDisplayedMnemonicIndex() >= 0 )
			return true;

		if( c instanceof AbstractButton && ((AbstractButton)c).getDisplayedMnemonicIndex() >= 0 )
			return true;

		if( c instanceof JTabbedPane ) {
			JTabbedPane tabPane = (JTabbedPane) c;
			int tabCount = tabPane.getTabCount();
			for( int i = 0; i < tabCount; i++ ) {
				if( tabPane.getDisplayedMnemonicIndexAt( i ) >= 0 )
					return true;
			}
		}

		return false;
	}
Special Alt key behavior on Windows.

Press-and-release Alt key selects first menu (if available) and moves focus
temporary to menu bar. If menu bar has focus (some menu is selected),
pressing Alt key unselects menu and moves focus back to permanent focus owner.
flatlaf-core/src/main/java/com/formdev/flatlaf/MnemonicHandler.java