Java Screen Center getCenterPoint()

Here you can find the source of getCenterPoint()

Description

get Center Point

License

Apache License

Declaration

public static Point getCenterPoint() 

Method Source Code


//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*/
}

Related

  1. getCenteringPoint(final Dimension frameDimension)
  2. getCenteringPointOnScreen(Dimension dimension)
  3. getCenterLocation(final Window frame)
  4. getCenterLocation(Window window)
  5. getCenterLocationAWT( final java.awt.Component comp, final boolean onTitleBarIfWindow)
  6. getCenterPoint(Component parent, Component comp)
  7. getCenterPoint(final int w, final int h)
  8. getCenterPointRelativeToScreen(Dimension size)
  9. getCenterPosition(Dimension d)