private int getMaxIconsWidth() {
		if( !verticallyAlignText )
			return 0;

		Container parent = menuItem.getParent();
		if( !(parent instanceof JComponent) )
			return 0;

		int maxWidth = FlatClientProperties.clientPropertyInt( (JComponent) parent, KEY_MAX_ICONS_WIDTH, -1 );
		if( maxWidth >= 0 )
			return maxWidth;

		maxWidth = 0;

		for( Component c : parent.getComponents() ) {
			if( !(c instanceof JMenuItem) )
				continue;

			Icon icon = ((JMenuItem)c).getIcon();
			if( icon != null )
				maxWidth = Math.max( maxWidth, icon.getIconWidth() );
		}

		((JComponent)parent).putClientProperty( KEY_MAX_ICONS_WIDTH, maxWidth );
		return maxWidth;
	}
Calculates the maximum width of all menu item icons in the popup.
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatMenuItemRenderer.java