protected void createButtons() {
		iconifyButton = createButton( "TitlePane.iconifyIcon", "Iconify", e -> iconify() );
		maximizeButton = createButton( "TitlePane.maximizeIcon", "Maximize", e -> maximize() );
		restoreButton = createButton( "TitlePane.restoreIcon", "Restore", e -> restore() );
		closeButton = createButton( "TitlePane.closeIcon", "Close", e -> close() );

		iconifyMaximizeGapComp = createButtonsGapComp();
		maximizeCloseGapComp = createButtonsGapComp();

		// initially hide buttons that are only supported in frames
		iconifyButton.setVisible( false );
		maximizeButton.setVisible( false );
		restoreButton.setVisible( false );
		iconifyMaximizeGapComp.setVisible( false );
		maximizeCloseGapComp.setVisible( false );

		buttonPanel = new JPanel() {
			@Override
			public Dimension getPreferredSize() {
				Dimension size = super.getPreferredSize();
				int titleBarHeight = clientPropertyInt( rootPane, TITLE_BAR_HEIGHT, -1 );
				if( titleBarHeight >= 0 )
					return new Dimension( size.width, UIScale.scale( titleBarHeight ) );

				if( buttonMaximizedHeight > 0 && isWindowMaximized() && !hasVisibleEmbeddedMenuBar( rootPane.getJMenuBar() ) ) {
					// make title pane height smaller when frame is maximized
					size = new Dimension( size.width, Math.min( size.height, UIScale.scale( buttonMaximizedHeight + buttonsMargins.top + buttonsMargins.bottom ) ) );
				}
				return size;
			}
		};
		buttonPanel.setOpaque( false );
		buttonPanel.setBorder( FlatUIUtils.nonUIResource( new FlatEmptyBorder( buttonsMargins ) ) );
		buttonPanel.setLayout( new BoxLayout( buttonPanel, BoxLayout.LINE_AXIS ) );
		if( rootPane.getWindowDecorationStyle() == JRootPane.FRAME ) {
			// JRootPane.FRAME works only for frames (and not for dialogs)
			// but at this time the owner window type is unknown (not yet added)
			// so we add the iconify/maximize/restore buttons, and they are shown
			// later in frameStateChanged(), which is invoked from addNotify()

			buttonPanel.add( iconifyButton );
			buttonPanel.add( iconifyMaximizeGapComp );
			buttonPanel.add( maximizeButton );
			buttonPanel.add( restoreButton );
			buttonPanel.add( maximizeCloseGapComp );
		}
		buttonPanel.add( closeButton );

		ComponentListener l = new ComponentAdapter() {
			@Override public void componentResized( ComponentEvent e ) { updateFullWindowContentButtonsBoundsProperty(); }
			@Override public void componentMoved( ComponentEvent e ) { updateFullWindowContentButtonsBoundsProperty(); }
		};
		buttonPanel.addComponentListener( l );
		addComponentListener( l );
	}
This panel paint a border at the top of the window in fullWindowContent mode,
if FlatLaf window decorations are enabled.
Only used on Windows 10.
<p>
This panel is not a child of the title pane.
Instead it is added by FlatRootPaneUI to the layered pane at a layer over all other layers.
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatTitlePane.java