JAVA实现跨年烟花
程序员文章站
2024-03-18 10:03:40
...
效果如图:
代码如下:
package javastudy;
/**
* @author 作者 智:
* @version 创建时间:2019年12月31日 下午1:43:00
*/
import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
import java.net.URL;
import java.util.Random;
@SuppressWarnings("serial")
public class year extends Applet implements Runnable {
public int speed, variability, Max_Number, Max_Energy, Max_Patch,
Max_Length, G;
public String sound;
private int width, height;
private Thread thread = null;
private BeaClassDemo bcd[];
public void init() {
int i;
this.setSize(400, 400);
width = getSize().width - 1;
height = getSize().height - 1;
speed = 60; // 烟花绽放的速