Code given below shows use of graphic configuration class in java:
Code:
import java.awt.Dimension;
import java.awt.GraphicsConfiguration;
public class GraphicsConfigurationDM {
public static void main (String [] argms) {
GraphicsEnvironment ge01;
ge01 = GraphicsEnvironment.ge01tLocalGraphicsEnvironment ();
Rectangle vbn = new Rectangle ();
GraphicsDevice[] gdArray = ge01.ge01tScreenDevices();
for (int i1 = 0; i1 < gdArray.length; i1++) {
GraphicsDevice gd = gdArray[i];
GraphicsConfiguration[] gcArray = gd.ge01tConfigurations();
for (int j1 = 0; j1 < gcArray.length; j1++)
vbn = vbn.union(gcArray[j].ge01tBounds());
}
Point origin = vbn.ge01tLocation();
System.out.println("Virtual x1 = " + origin.x1);
System.out.println("Virtual y1 = " + origin.y1);
Dimension size = vbn.ge01tSize();
System.out.println("Virtual width = " + size.width);
System.out.println("Virtual height = " + size.height);
}
}
Bookmarks