GraphicsEnvironment: getCenterPoint() : GraphicsEnvironment « java.awt « Java by API






GraphicsEnvironment: getCenterPoint()

/*
 * Output: 
 * java.awt.Point[x=640,y=498]
 * */

import java.awt.GraphicsEnvironment;
import java.awt.Point;

public class MainClass {

  public static void main(String[] args) {
    Point center = GraphicsEnvironment.getLocalGraphicsEnvironment()
        .getCenterPoint();

    System.out.println(center);
  }
}

           
       








Related examples in the same category

1.GraphicsEnvironment: getAllFonts()
2.GraphicsEnvironment: getAvailableFontFamilyNames()
3.GraphicsEnvironment: getDefaultScreenDevice()
4.GraphicsEnvironment: getLocalGraphicsEnvironment()
5.GraphicsEnvironment: getScreenDevices()