@# AUI的概念
比较古老,但是需要理解一下。监听和MVC架构,
其中核心技术就是Swing 和AWT
1、AWT 1.1 AWT介绍1.包含了很多类和接口; GUI:图形页面
2.元素;窗口,按钮,文板框
3.java.awt
2.组件和容器package com.guoguo.lesson01;
import java.awt.*;
public class testframe {
public static void main(String[] args) {
//frame.jdk 看源码
frame frame = new frame("图形界面窗口");
//看不见,设置可见性
frame.setVisible(true);
//设置大小
frame.setSize(400,500);
//设置背景颜色
//Color color = new Color();
frame.setBackground(new Color(70, 72, 104));
//弹出的初始位置
frame.setLocation(200,200);
//设置大小固定
frame.setResizable(false);
}
}
不能关闭
多窗口package com.guoguo.lesson01;
import java.awt.*;
public class lesson02frame {
public static void main(String[] args) {
//展示多个窗口
new Myframe(100,100,200,200,Color.blue);
new Myframe(300,100,200,200,Color.yellow);
new Myframe(100,300,200,200,Color.red);
new Myframe(300,300,200,200,Color.green);
}
}
//继承frame类
class Myframe extends frame{
static int id =0;//可能存在多个窗口,我们需要一个计数器
public Myframe(int x,int y,int w,int h,Color color){
super("Myframe"+(++id));
setBackground(color);
setBounds(x,y,w,h);
setVisible(true);
}
}



