Java tutorial
//package com.java2s; // Copyright 2011-2012 Paulo Augusto Peccin. See licence.txt distributed with this file. import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; public class Main { public static GraphicsConfiguration defaultScreenDeviceConfiguration() { return defaultScreenDevice().getDefaultConfiguration(); } public static GraphicsDevice defaultScreenDevice() { GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); if (env == null) throw new UnsupportedOperationException("Could not get Local Graphics Environment"); GraphicsDevice dev = env.getDefaultScreenDevice(); if (dev == null) throw new UnsupportedOperationException("Could not get Default Graphics Device"); return dev; } }