是一个applet程序,代码如下(教我的老师是个教授,当时问的匆忙 他也没看出啥名堂) 求教各位达人
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javaapplication2;/**
 *
 * @author Administrator
 */
import java.awt.*;
import javax.swing.*;
class Sanjiao extends JPanel implements Runnable{
    static int[][] x = {{200,400,300},{250,450,350},{300,500,400},{350,550,450},
        {300,500,400},{250,450,350},{200,400,300}};//三角形横坐标
    
    static int[] y = {100,100,200};//三角形纵坐标
    int[] a =new int[3];
   
    int j=0;
    
    public void paintComponent(Graphics g){
        super.paintComponent(g);
        for(int i=0;i<3;i++)
        {a[i]=x[j][i];}
        
        g.drawPolygon(a, y, 3);
        
        j = (j+1)%7;
    
    }
    public void run()
    {
        while(true)
        {
            repaint();
            try{
                Thread.sleep(200);
            }catch(InterruptedException e){}
        }
    }
}
public class SanjiaoDemo extends JApplet
{
      Sanjiao sj  = new Sanjiao();
    public void init ()
    {
        setSize(1000,500);//设置窗口大小
      
        add(sj,BorderLayout.CENTER);
        
    }
    public void start()
    {
        while(true){
            Thread t = new Thread(sj);
            t.start();
    }
    }
}
javaapplet