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);
    }

  

posted @ 2021-07-30 13:33  云村的王子  阅读(413)  评论(0编辑  收藏  举报