📄 multiplescreendemo1.java
字号:
// MultipleScreenDemo1.java
import java.awt.*;
class MultipleScreenDemo1
{
public static void main (String [] args)
{
GraphicsEnvironment ge;
ge = GraphicsEnvironment.getLocalGraphicsEnvironment ();
Rectangle vBounds = new Rectangle ();
GraphicsDevice [] gdArray = ge.getScreenDevices();
for (int i = 0; i < gdArray.length; i++)
{
GraphicsDevice gd = gdArray [i];
GraphicsConfiguration [] gcArray = gd.getConfigurations ();
for (int j = 0; j < gcArray.length; j++)
vBounds = vBounds.union (gcArray [j].getBounds ());
}
Point origin = vBounds.getLocation ();
System.out.println ("Virtual x = " + origin.x);
System.out.println ("Virtual y = " + origin.y);
Dimension size = vBounds.getSize ();
System.out.println ("Virtual width = " + size.width);
System.out.println ("Virtual height = " + size.height);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -