Java GraphicsEnvironment .getCenterPoint ()
Syntax
GraphicsEnvironment.getCenterPoint() has the following syntax.
public Point getCenterPoint() throws HeadlessException
Example
In the following code shows how to use GraphicsEnvironment.getCenterPoint() method.
// www . j a va 2s. com
import java.awt.GraphicsEnvironment;
import java.awt.Point;
public class Main {
public static void main(String[] args) {
Point center = GraphicsEnvironment.getLocalGraphicsEnvironment()
.getCenterPoint();
System.out.println(center);
}
}
The code above generates the following result.
Home »
Java Tutorial »
java.awt »
Java Tutorial »
java.awt »