Check out this thread on StackOverflow. The code in from the OP uses this code:
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gs = ge.getScreenDevices();
for(GraphicsDevice curGs : gs)
{
GraphicsConfiguration[] gc = curGs.getConfigurations();
for(GraphicsConfiguration curGc : gc)
{
Rectangle bounds = curGc.getBounds();
System.out.println(bounds.getX() + "," + bounds.getY() + " " + bounds.getWidth() + "x" + bounds.getHeight());
}
}
The output was:
0.0,0.0 1024.0x768.0
0.0,0.0 1024.0x768.0
0.0,0.0 1024.0x768.0
0.0,0.0 1024.0x768.0
0.0,0.0 1024.0x768.0
0.0,0.0 1024.0x768.0
1024.0,0.0 1024.0x768.0
1024.0,0.0 1024.0x768.0
1024.0,0.0 1024.0x768.0
1024.0,0.0 1024.0x768.0
1024.0,0.0 1024.0x768.0
1024.0,0.0 1024.0x768.0
So, you can see it returns two screens. He had two screens of 1024x768, positioned next to each other.
The code can be optimized to, since you only want width and height:
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gs = ge.getScreenDevices();
for(GraphicsDevice curGs : gs)
{
DisplayMode dm = curGs.getDisplayMode();
System.out.println(dm.getWidth() + " x " + dm.getHeight());
}