public static void main( String[] args ) {
		SwingUtilities.invokeLater( () -> {
			FlatLightLaf.setup();

			JFrame frame = new JFrame( "FlatScreenshotsBackground" );
			frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );

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

			JCheckBox black = new JCheckBox( "black" );
			black.setOpaque( false );
			black.setVerticalAlignment( SwingConstants.TOP );
			black.addActionListener( e -> {
				if( black.isSelected() )
					FlatDarkLaf.setup();
				else
					FlatLightLaf.setup();
				FlatLaf.updateUI();

				Color color = black.isSelected() ? Color.black : Color.white;
				frame.getContentPane().setBackground( color );
				frame.getRootPane().putClientProperty( FlatClientProperties.TITLE_BAR_BACKGROUND, color );
				frame.repaint();
			} );
			frame.getContentPane().add( black );

			frame.getContentPane().setBackground( Color.white );
			frame.getRootPane().putClientProperty( FlatClientProperties.TITLE_BAR_BACKGROUND, Color.white );

			frame.setExtendedState( JFrame.MAXIMIZED_BOTH );
			frame.setVisible( true );
		} );
	}
Fills entire screen with white or black.
Use as background when tacking screenshots to avoid that light/dark background
shines through window border.

@author Karl Tauber
flatlaf-testing/src/main/java/com/formdev/flatlaf/testing/screenshots/FlatScreenshotsBackground.java