Java examples for java.awt:GraphicsDevice
merge All Screens via GraphicsDevice
//package com.java2s; import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; import java.awt.Rectangle; public class Main { public static void main(String[] argv) throws Exception { System.out.println(mergeAllScreens()); }/* w w w . j ava2 s . c o m*/ /** * @return a rectangle consisting of a union of the rectangles of all * screens */ public static Rectangle mergeAllScreens() { Rectangle virtualBounds = new Rectangle(); final GraphicsEnvironment ge = GraphicsEnvironment .getLocalGraphicsEnvironment(); for (final GraphicsDevice gd : ge.getScreenDevices()) { for (final GraphicsConfiguration element : gd .getConfigurations()) { virtualBounds = virtualBounds.union(element.getBounds()); } } return virtualBounds; } }