static void install( Window window ) {
		if( hasCustomDecoration( window ) )
			return;

		// do not enable native window border if LaF provides decorations
		if( UIManager.getLookAndFeel().getSupportsWindowDecorations() )
			return;

		if( window instanceof JFrame ) {
			JFrame frame = (JFrame) window;
			JRootPane rootPane = frame.getRootPane();

			// check whether disabled via system property, client property or UI default
			if( !useWindowDecorations( rootPane ) )
				return;

			// do not enable native window border if frame is undecorated
			if( frame.isUndecorated() )
				return;

			// enable native window border for window
			setHasCustomDecoration( frame, true );

			// avoid double window title bar if enabling native window border failed
			if( !hasCustomDecoration( frame ) )
				return;

			// enable Swing window decoration
			rootPane.setWindowDecorationStyle( JRootPane.FRAME );

		} else if( window instanceof JDialog ) {
			JDialog dialog = (JDialog) window;
			JRootPane rootPane = dialog.getRootPane();

			// check whether disabled via system property, client property or UI default
			if( !useWindowDecorations( rootPane ) )
				return;

			// do not enable native window border if dialog is undecorated
			if( dialog.isUndecorated() )
				return;

			// enable native window border for window
			setHasCustomDecoration( dialog, true );

			// avoid double window title bar if enabling native window border failed
			if( !hasCustomDecoration( dialog ) )
				return;

			// enable Swing window decoration
			rootPane.setWindowDecorationStyle( JRootPane.PLAIN_DIALOG );
		}
	}
Support for custom window decorations with native window border.

@author Karl Tauber
@since 1.1
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatNativeWindowBorder.java