Java实现桃花心形、动态雪花特效、炫动字体
package uu;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Font;
import java.awt.Image;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.util.Random;
public class u{
public static void main(String[] args)
{
JFrame frame=new JFrame();
frame.setSize(800,600);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(3);
frame.setBackground(Color.BLACK);
mypanel p=new mypanel();
frame.add(p);
frame.setVisible(true);
Thread t=new Thread(p);
t.start();
}
}
class mypanel extends JPanel implements Runnable{
private static final long serialVersionUID=1L;
Font font=new Font("font",Font.BOLD,50);
String colors[]={"red","yellow","blue"};
Random random=new Random();
int[] snowx=new int [600];
int[] snowy=new int[600];
int[] snowy1=new int[600];
public mypanel()
{
for(int i=0;i |