Here you can find the source of getCenterPoint()
public static Point getCenterPoint()
//package com.java2s; //License from project: Apache License import java.awt.*; public class Main { public static Point getCenterPoint() { Toolkit toolkit = Toolkit.getDefaultToolkit(); double desktopHeight = toolkit.getScreenSize().getHeight(); double desktopWidth = toolkit.getScreenSize().getWidth(); return new Point((int) desktopWidth / 2, (int) desktopHeight / 2); }/* w w w.java 2 s . c o m*/ }