private int findSubMenu( MenuElement[] path ) {
		for( int i = path.length - 1; i >= 1; i-- ) {
			if( path[i] instanceof JPopupMenu &&
				path[i - 1] instanceof JMenu &&
				!((JMenu)path[i - 1]).isTopLevelMenu() )
			  return i;
		}
		return -1;
	}
Improves usability of submenus by using a
<a href="https://height.app/blog/guide-to-build-context-menus#safe-triangle">safe triangle</a>
to avoid that the submenu closes while the user moves the mouse to it.

@author Karl Tauber
flatlaf-core/src/main/java/com/formdev/flatlaf/SubMenuUsabilityHelper.java