All pastes #464789 Raw Edit

Miscellany

public text v1 · immutable
#464789 ·published 2007-04-29 18:30 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,y;

	public void init() {
	setBackground(Color.gray);
	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++;

	if ( y == 100 ) {
	y = 400;
	setBackground(Color.black); }

	y++;
	repaint();

	try {
	the_thread.sleep(30); }
	
	catch(InterruptedException e) {
	showStatus("aborted"); }
}}}