アットウィキロゴ

game0707

import java.awt.*;
import java.awt.event.*;

class game0707 extends Frame implements Runnable{

int t;
Image img1;

public static void main(String [] args) {
        Frame f=new game0707();
        f.setTitle("game0707");
        f.setSize(500,600);
        f.setBackground(Color.white);
        f.setVisible(true);
    }

game0707(){

img1 = Toolkit.getDefaultToolkit().getImage("0219.jpg");

t=0;

Thread th=new Thread(this);
th.start();
addWindowListener(new stopwin());
}

class stopwin extends WindowAdapter{
    public void windowClosing(WindowEvent we){System.exit(0);}
}  


public void run(){  
t=1;  

while(t<10){
repaint();
try{
Thread.sleep(1000);
}catch(InterruptedException e){}
t=t+1;  
}  

}


public void paint(Graphics g){

g.drawImage(img1,0,0,500,500,this);    
g.setColor(Color.white);
g.fillRect(0,500,500,100);  
g.setColor(Color.black);  
if(t==1)g.drawString("きれい",100,550);
if(t==2)g.drawString("きれ",100,550);
if(t==3)g.drawString("き",100,550);
if(t==2)g.drawString("きれ",100,550);

}
}
最終更新:2011年02月27日 11:03