private JFrame createFrame() {
		JFrame frame = new JFrame();
		frame.setTitle( "UI Defaults Inspector" );
		frame.setDefaultCloseOperation( WindowConstants.DISPOSE_ON_CLOSE );
		frame.addWindowListener( new WindowAdapter() {
			@Override
			public void windowClosed( WindowEvent e ) {
				inspectorFrame = null;
			}
			@Override
			public void windowClosing( WindowEvent e ) {
				saveWindowBounds( frame );
			}
			@Override
			public void windowDeactivated( WindowEvent e ) {
				saveWindowBounds( frame );
			}
		} );

		updateWindowTitle( frame );

		frame.getContentPane().add( panel, BorderLayout.CENTER );

		// restore window bounds
		Preferences prefs = getPrefs();
		int x = prefs.getInt( "x", -1 );
		int y = prefs.getInt( "y", -1 );
		int width = prefs.getInt( "width", UIScale.scale( 600 ) );
		int height = prefs.getInt( "height", UIScale.scale( 800 ) );
		frame.setSize( width, height );
		if( x != -1 && y != -1 ) {
			frame.setLocation( x, y );
			ensureOnScreen( frame );
		} else
			frame.setLocationRelativeTo( null );

		// register ESC key to close frame
		((JComponent)frame.getContentPane()).registerKeyboardAction(
			e -> frame.dispose(),
			KeyStroke.getKeyStroke( KeyEvent.VK_ESCAPE, 0, false ),
			JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT );

		return frame;
	}
Creates a UI defaults inspector panel that can be embedded into any window.
flatlaf-extras/src/main/java/com/formdev/flatlaf/extras/FlatUIDefaultsInspector.java