code: public static void centerOnScreen(Window window) {
  		Assert.notNull(window, "window cannot be null");
  
  		// This works around a bug in setLocationRelativeTo(...): it currently
  		// does not take multiple monitors into accounts on all operating
  		// systems.
  		try {
  			// Note that if this is running on a JVM prior to 1.4, then an
  			// exception will be thrown and we will fall back to
  			// setLocationRelativeTo(...).
  			final Rectangle screenBounds = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
  
  			final Dimension windowSize = window.getSize();
  			final int x = screenBounds.x + ((screenBounds.width - windowSize.width) / 2);
  			final int y = screenBounds.y + ((screenBounds.height - windowSize.height) / 2);
  			window.setLocation(x, y);
  		}
  		catch (Throwable t) {
  			window.setLocationRelativeTo(window);
  		}
  	}
docs: Take the window and center it on the screen.
  <p>
  This works around a bug in setLocationRelativeTo(...): it currently does
  not take multiple monitors into accounts on all operating systems.
  
  @param window the window to center