All pastes #459903 Raw Edit

Miscellany

public text v1 · immutable
#459903 ·published 2007-04-26 19:20 UTC
rendered paste body
import java.applet.*;
import java.awt.*;
import java.applet.Applet;

	public class proodos2 extends Applet implements Runnable {

		Thread the_thread;
		int count;
		int move01=200;
		Image photo01;
		int x;
		int y;
		int waiter;	

	public void init() {
	photo01=getImage(getCodeBase(),"photo01.jpg"); }

	public void start() {
	count=0;
	Thread the_thread=new Thread(this);
	the_thread.start(); }

	public void stop() {
	the_thread=null; }

	public void paint(Graphics g) {
	g.drawImage(photo01,x,y,200,200,this); }

	public void run() {
		while (count<move01) {
			count++;
			y+=100;
			try {
				the_thread.sleep(5000); 
			} catch (InterruptedException e) { }
			g.drawImage(photo01,x,y,200,200,this);
			repaint();
			try {
				the_thread.sleep(19); 
			}
			catch(InterruptedException e) {
				showStatus("aborted"); 
			}
		}
	}
}