code: private void setTitlePane(JRootPane root, JComponent titlePane) {
          JLayeredPane layeredPane  = root.getLayeredPane();
          JComponent   oldTitlePane = getTitlePane();
  
          if (oldTitlePane != null) {
              oldTitlePane.setVisible(false);
              layeredPane.remove(oldTitlePane);
          }
  
          if (titlePane != null) {
              layeredPane.add(titlePane, JLayeredPane.FRAME_CONTENT_LAYER);
              titlePane.setVisible(true);
          }
  
          this.titlePane = titlePane;
      }
docs: Sets the window title pane -- the JComponent used to provide a plaf a way
  to override the native operating system's window title pane with one
  whose look and feel are controlled by the plaf. The plaf creates and sets
  this value; the default is null, implying a native operating system
  window title pane.
  
  @param root      content the <code>JComponent</code> to use for the
  window title pane.
  @param titlePane the SeaGlassTitlePane.