package Test;
import java.awt.*;
public class Jproject4 {
public static void main(String[] args) throws Exception{
Frame f = new Frame("容器颜色变化");
f.setSize(200, 300); //设置窗口体的大小
f.setVisible(true); //设置窗口的可见性
for (int i = 0; i < 255; i++) {
f.setBackground(new Color(i, 0, 0));//设置窗口体的颜色
Thread.sleep(10); //延迟
}
System.exit(0);
}
}