Java GUI 의 Graphics Environment

857 단어
package com.sinosuperman.driver;

import java.awt.GraphicsEnvironment;
import java.awt.Rectangle;

public class MainBench {
	public static void main(String[] args) {
		GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
		
		Rectangle rec = env.getMaximumWindowBounds();
		System.out.println("Rectangle: " + rec);
		System.out.println("Rectangle center x: " + rec.getCenterX());
		System.out.println("Rectangle center y: " + rec.getCenterY());
		
		System.out.println("Environment center point: " + env.getCenterPoint());
		System.out.println("Environment center point x: " + env.getCenterPoint().getX());
		System.out.println("Environment center point y: " + env.getCenterPoint().getY());
	}
}

원본 링크:http://blog.csdn.net/poechant/article/details/7015596

좋은 웹페이지 즐겨찾기