private void showMediumWeightDropShadow() {
			if( mediumWeightShown )
				return;

			mediumWeightShown = true;

			if( owner == null )
				return;

			Window window = SwingUtilities.windowForComponent( owner );
			if( !(window instanceof RootPaneContainer) )
				return;

			dropShadowPanel.setVisible( false );

			JLayeredPane layeredPane = ((RootPaneContainer)window).getLayeredPane();
			layeredPane.add( dropShadowPanel, JLayeredPane.POPUP_LAYER, 0 );

			moveMediumWeightDropShadow();
			resizeMediumWeightDropShadow();

			mediumPanelListener = new ComponentListener() {
				@Override
				public void componentShown( ComponentEvent e ) {
					if( dropShadowPanel != null )
						dropShadowPanel.setVisible( true );
				}

				@Override
				public void componentHidden( ComponentEvent e ) {
					if( dropShadowPanel != null )
						dropShadowPanel.setVisible( false );
				}

				@Override
				public void componentMoved( ComponentEvent e ) {
					moveMediumWeightDropShadow();
				}

				@Override
				public void componentResized( ComponentEvent e ) {
					resizeMediumWeightDropShadow();
				}
			};
			mediumWeightPanel.addComponentListener( mediumPanelListener );
		}
Fixes popup background flashing effect when using dark theme on light platform theme,
where the light popup background is shown for a fraction of a second before
the dark popup content is shown.
This is fixed by setting popup background to content background.
<p>
Defers hiding of heavy weight popup window for an event cycle,
which allows reusing popup window to avoid flicker when "moving" popup.
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatPopupFactory.java