Here you can find the source of setLocationToCenter(Window window)
Parameter | Description |
---|---|
window | to set to the screen center |
public static void setLocationToCenter(Window window)
//package com.java2s; //License from project: Open Source License import java.awt.*; public class Main { /**//from ww w.ja v a2 s.c om * Sets the given {@link Window} to the center of the sceen * * @param window to set to the screen center */ public static void setLocationToCenter(Window window) { window.setLocationRelativeTo(null); } }