简单的水波图

/**
* @(#)SlowCircle.java
*
* Sample Applet application
*
* @author
* @version 1.00 04/09/25
*/

import java.awt.*;
import javax.swing.*;
import java.lang.*;

public class SlowCircle extends JApplet implements Runnable {
int i;
Thread t;

public void init() {
t = new Thread(this);
t.start();
}

public void paint(Graphics g) {
for( i = 0 ; i < getWidth() / 2; i = i + 5){
g.drawOval(200 - i / 2 ,200 - i / 2,i,i );
try{
t.sleep(50);
}
catch(InterruptedException e){}
}
}

public void run(){
paint();

}

}

import java.awt.*;
import javax.swing.*;
import java.lang.*;

public class SlowCircle extends JApplet implements Runnable {
int i;
Thread t;

public void init() {
t = new Thread(this);
t.start();
}

public void paint(Graphics g) {
for( i = 0 ; i < getWidth() / 2; i = i + 5){
g.drawOval(200 - i / 2 ,150 - i / 2,i,i );
try{
t.sleep(50);
}
catch(InterruptedException e){}
}
}

public void run(){
paint(this.getGraphics());
}

}

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试