public static void centerOnWindow(Component componentToMove){
  center(componentToMove,SwingUtilities.windowForComponent(componentToMove));
}

public static void centerOnWindow ( Component componentToMove ) { center ( componentToMove , SwingUtilities . windowForComponent ( componentToMove ) ) ; }
centers the component on its window
