MikoPata.java


import	java.applet.*;
import	java.awt.*;
import	java.lang.*;
import	java.net.*;
import	java.io.*;

public class MikoPata extends Applet implements Runnable {
	MediaTracker	tracker;
	Image		miko[] = new Image[8];
	int		mikoIndex[] = { 1,2,3,4,5,6,1,2,3,4,5,6,1,7,8,7,1,7,8,7 };
	int		index = 0;
	Thread		animator;

	public void init() {
		tracker = new MediaTracker( this );
		for( int i=0; i<8 ; i++ ) { miko[i]="getImage(" getdocumentbase(), "miko"+(i+1)+".gif" ); tracker.addimage( miko[i], 1 ); }; }; public void start() { animator="new" thread( this ); animator.start(); }; public void stop() { animator.stop(); animator="null;" }; public void run() { try { tracker.waitforid(1); } catch( interruptedexception e ) { return; }; thread me="Thread.currentThread();" while( animator="=" me ) { try { thread.sleep( 100 ); } catch( interruptedexception e ) { break; }; synchronized( this ) { index++; if( index>= mikoIndex.length ) {
					index = 0;
				};
			};
			repaint();
		};
	};

	public void update( Graphics g ) {
		paint(g);
	};

	public void paint( Graphics g ) {
		g.setColor( Color.white );
		if( (tracker.statusAll( false ) & MediaTracker.ERRORED) != 0 ) {
			g.setColor( Color.black );
			g.fillRect( 0 , 0 , size().width , size().height );
			g.setColor( Color.red );
			g.drawString( "*.gif File load Error!" , 0 , size().height );
			return;
		};

		if( tracker.statusID( 1 , false ) != MediaTracker.COMPLETE ) {
			g.setColor( Color.black );
			g.fillRect( 0 , 0 , size().width , size().height );
			g.setColor( Color.white );
			g.drawString( "Now loading....." , 0 , size().height );
			return;
		};

		Image	im = miko[ mikoIndex[ index ] -1 ];

		g.drawImage( im, 0, 0, size().width, size().height, this );
	};

	public boolean mouseDown( Event Evt , int x , int y ) {
		play( getDocumentBase() , "AKURYOU1.au" );
		return( true );
	};
};

–ß‚é