private boolean showBorder( Component c ) {
			Container parent = c.getParent();
			return
				(parent instanceof JFrame &&
				 (((JFrame)parent).getJMenuBar() == null ||
				  !((JFrame)parent).getJMenuBar().isVisible())) ||
				(parent instanceof JDialog &&
				 (((JDialog)parent).getJMenuBar() == null ||
				  !((JDialog)parent).getJMenuBar().isVisible()));
		}
Window border used for non-native window decorations.
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatRootPaneUI.java