Java tutorial
//package com.java2s; import java.awt.Window; public class Main { /** * Centers the given {@link Window} on the screen using * {@link Window#setLocationRelativeTo(Component)}. * * @param frame * - the window to center */ public static void drop(Window frame) { frame.setLocationRelativeTo(null); } }