You can get a list of GraphicDevice
s from the GraphicsEnvironment
. Each GraphicsDevice
would represent a screen.
Now, you have a number of choices...
You could simply look through the list of GraphicsDevices
and simply find the one with the lowest x/y coordinates or you could combine them all into a "virtual screen" and simply extract the top/left coordinates from it.
For example...
public static Rectangle getVirtualScreenBounds() {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice lstGDs[] = ge.getScreenDevices();
Rectangle bounds = new Rectangle();
for (GraphicsDevice gd : lstGDs) {
bounds.add(gd.getDefaultConfiguration().getBounds());
}
return bounds;
}