Java tutorial
//package com.java2s; //License from project: Open Source License import java.awt.Dimension; import java.awt.GraphicsEnvironment; public class Main { public static Dimension getScreenDimension() { int width = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode() .getWidth(); int height = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode() .getHeight(); Dimension d = new Dimension(width, height); return d; } }