private static void printScreenInfo() {
		Toolkit toolkit = Toolkit.getDefaultToolkit();
		GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
		GraphicsDevice defaultScreenDevice = graphicsEnvironment.getDefaultScreenDevice();
		GraphicsDevice[] screenDevices = graphicsEnvironment.getScreenDevices();

		System.out.print( "Scale factors:  " );
		for( GraphicsDevice gd : screenDevices ) {
			GraphicsConfiguration gc = gd.getDefaultConfiguration();

			if( gd != screenDevices[0] )
				System.out.print( " / " );

			System.out.print( (int) (gc.getDefaultTransform().getScaleX() * 100) );
			System.out.print( "%" );
		}
		System.out.println();

		System.out.println( "Java version:   " + System.getProperty( "java.version" ) );
		System.out.println( "Java vendor:    " + System.getProperty( "java.vendor" ) );

		for( GraphicsDevice gd : screenDevices ) {
			GraphicsConfiguration gc = gd.getDefaultConfiguration();
			DisplayMode displayMode = gd.getDisplayMode();
			Rectangle bounds = gc.getBounds();
			int width = displayMode.getWidth();
			int height = displayMode.getHeight();
			double boundsScaleX = (bounds.width > width)
				? (double) bounds.width / (double) width
				: -((double) width / (double) bounds.width);
			double boundsScaleY = (bounds.height > height)
				? (double) bounds.height / (double) height
				: -((double) height / (double) bounds.height);
			boundsScaleX = Math.round( boundsScaleX * 1000. ) / 1000.;
			boundsScaleY = Math.round( boundsScaleY * 1000. ) / 1000.;
			Insets screenInsets = toolkit.getScreenInsets( gc );
			AffineTransform defaultTransform = gc.getDefaultTransform();
			double scaleX = defaultTransform.getScaleX();
			double scaleY = defaultTransform.getScaleY();

			System.out.println();
			System.out.print( "ID:      " + gd.getIDstring() );
			if( gd == defaultScreenDevice )
				System.out.print( " (main)" );
			System.out.println();

			System.out.printf( "Size:    %d x %d / %d Bit / %d Hz%n",
				displayMode.getWidth(), displayMode.getHeight(),
				displayMode.getBitDepth(), displayMode.getRefreshRate() );
			System.out.printf( "Bounds:  %d x %d / x %d / y %d",
				bounds.width, bounds.height, bounds.x, bounds.y );
			if( Math.abs( boundsScaleX ) != 1 || Math.abs( boundsScaleY ) != 1 )
				System.out.printf( "   (scale %s)", toString( boundsScaleX, boundsScaleY ) );
			System.out.println();
			System.out.printf( "Insets:  left %d / right %d / top %d / bottom %d%n",
				screenInsets.left, screenInsets.right, screenInsets.top, screenInsets.bottom );
			System.out.println( "Scale:   " + toString( scaleX, scaleY ) );

			// report warning if screen bounds intersects with another screen
			// https://github.com/JFormDesigner/FlatLaf/issues/177
			for( GraphicsDevice gd2 : screenDevices ) {
				if( gd2 == gd )
					continue;

				Rectangle bounds2 = gd2.getDefaultConfiguration().getBounds();
				if( bounds2.intersects( bounds ) ) {
					System.out.println( "Warning: bounds of this screen intersect with bounds of " + gd2.getIDstring() );
					System.out.println( "         this can lead to misplaced popups" );
				}
			}
		}
	}
Displays information about screens connected to a computer.

This is a single-file program that can be compiled/run without any other
FlatLaf code or dependencies.

Since Java 11, you can run this program from source with:
    java FlatScreenInfo.java

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