アットウィキロゴ

あppぇ0705

import java.applet.Applet;
import java.awt.Graphics;

public class apple0705 extends Applet implements Runnable
{
   int num;

   public void init()
   {
      Thread th;
      th = new Thread(this);
      th.start();
   }
   public void run()
   {
      try{
         for(int i=0; i<10; i++){
            num = i;
            repaint();
            Thread.sleep(1000);
         }
      }
      catch(InterruptedException e){}
   }
   public void paint(Graphics g)
   {
      String str = num + "です。";
      g.drawString(str, 10, 10);
   }
}
最終更新:2010年09月16日 11:00