package cn.itcast_01;
import java.awt.Frame;
import java.awt.Point;
public class FrameDemo2 {
public static void main(String[] args) {
// 创建窗体对象
Frame f = new Frame("方法调用的前后关系");
// f.setVisible(true);
// try {
// Thread.sleep(3000);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// 设置窗体大小
// f.setSize(400, 300);
// Dimension(int width,int height)
// Dimension d = new Dimension(400, 300);
// f.setSize(d);
// 设置窗体位置
// f.setLocation(400, 200);
// Point(int x, int y)
// Point p = new Point(400, 200);
// f.setLocation(p);
// 一个方法就搞定
f.setBounds(400, 200, 400, 300);
// 设置窗体可见
f.setVisible(true);
}
}
GUI_优化HelloWorld窗体案例代码
最新推荐文章于 2017-10-24 21:13:06 发布