Java获取显示器屏幕大小
public static void main(String[] args) { Dimension screensize = Toolkit.getDefaultToolkit().getScreenSize(); int width = (int)screensize.getWidth(); int height = (int)screensize.getHeight(); System.out.println("宽度:" + width + " 高度:" + height); }