package com.zeng.GUI;
import java.awt.*;
public class TestFrame2 {
public staticvoidmain(String[] args){//展示多个窗口
Myframe myframe1 = new Myframe(100,100,400,400, Color.red);
Myframe myframe2 = new Myframe(500,100,400,400, Color.yellow);
Myframe myframe3 = new Myframe(100,500,400,400, Color.blue);
Myframe myframe4 = new Myframe(500,500,400,400, Color.green);}}
class Myframe extends Frame {staticint id =0;
public Myframe(int x,int y,int w,int h, Color color){super("Myframe"+(++id));setBounds(x, y, w, h);//设置位置和窗口大小setBackground(color);//设置窗口颜色setResizable(true);//设置窗口是否可以伸缩setVisible(true);//设置窗口是否可见}}