import java.awt.*;
import java.awt.event.*;
class game0708 extends Frame implements Runnable{
int t;
Image img1;
Image off;
Graphics offsc;
public static void main(String [] args) {
Frame f=new game0708();
f.setTitle("game0708");
f.setSize(500,600);
f.setBackground(Color.white);
f.setVisible(true);
}
game0708(){
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;
repaint();
try{
Thread.sleep(5000);
}catch(InterruptedException e){}
t=2;
while(t<10){
repaint();
try{
Thread.sleep(1000);
}catch(InterruptedException e){}
t=t+1;
}
}
public void update(Graphics g){
paint(g);
}
public void paint(Graphics g){
off = createImage(500,600);
offsc = off.getGraphics();
offsc.drawImage(img1,0,50,500,500,this);
offsc.setColor(Color.white);
offsc.fillRect(0,550,500,50);
offsc.setColor(Color.black);
if(t==1)offsc.drawString("少しお待ちください",100,550);
if(t==2)offsc.drawString("きれ",100,550);
if(t==3)offsc.drawString("き",100,550);
if(t>3)offsc.drawString("きれ",100,550);
g.drawImage(off,0,0,this);
}
}
最終更新:2011年02月27日 11:22