static JComponent getTitlePaneComponent(Window window) { if (!substanceLookAndFeelEnabled()) ret null; JRootPane rootPane = null; if (window instanceof JFrame) rootPane = ((JFrame) window).getRootPane(); if (window instanceof JDialog) rootPane = ((JDialog) window).getRootPane(); if (rootPane != null) { O /*SubstanceRootPaneUI*/ ui = rootPane.getUI(); return (JComponent) call(ui, "getTitlePane"); } return null; }