@Override
	public void stateChanged( ChangeEvent e ) {
		if( eventQueuePushNotSupported || !FlatUIUtils.getUIBoolean( KEY_USE_SAFE_TRIANGLE, true ))
			return;

		// handle menu selection change later, but only once in case of temporary changes
		// e.g. moving mouse from one menu item to another one, fires two events:
		//    1. old menu item is removed from menu selection
		//    2. new menu item is added to menu selection
		synchronized( this ) {
			if( changePending )
				return;
			changePending = true;
		}

		EventQueue.invokeLater( () -> {
			synchronized( this ) {
				changePending = false;
			}
			menuSelectionChanged();
		} );
	}
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