Java examples for Swing:Screen
get Screen Width
//package com.java2s; import java.awt.GraphicsEnvironment; public class Main { public static int getScreenWidth() { int x = GraphicsEnvironment.getLocalGraphicsEnvironment() .getDefaultScreenDevice().getDisplayMode().getWidth(); return x; }/*from w ww . jav a 2s.c o m*/ }