applet都快要淘汰了诶
import java.applet.*;
import java.awt.*;
import javax.swing.*;
public class S extends JApplet implements Runnable{
Thread thread;
private int x=20;
private String ss = "make the change";
public Font font = new Font("Arial",Font.BOLD,50);
private int y=200;
public void init(){
thread = new Thread(this);
thread.start();
}
public void run(){
while(true){
repaint();
try{
thread.sleep(100);
}catch(Exception e){
System.out.println("interruption");
}
}
}
public void paint(Graphics g){
super.paint(g);
g.setFont(font);
g.drawString(ss, x, y);
Image iBuffer = createImage(this.getSize().width,this.getSize().height);
Graphics gBuffer = iBuffer.getGraphics();
x+=5;
if(x==600)
x=0;
}
}