java设置程序窗口在屏幕中间

1.获取屏幕大小

		int screenWidth = (int) this.getToolkit().getScreenSize().getWidth();
		int screenHeight = (int) this.getToolkit().getScreenSize().getHeight();

2.设置程序坐标

		int x = (screenWidth - Width)/2;
		int y = (screenHeight - Height)/2;


展开阅读全文

没有更多推荐了,返回首页