import java.awt.*;import java.applet.Applet;public class MouseCheeseApplet extends Applet implements Runnable {		Thread moveMice;		mouse mouse1;	mouse mouse2;	cheese theCheese;		public void start() {				if (moveMice == null) {			moveMice = new Thread(this);			moveMice.start();		}	}		public void stop() {		if (moveMice != null) {			moveMice.stop();			moveMice = null;		}	}		public void run() {			mouse1 = new mouse(0,0,2);		mouse2 = new mouse(0,0,3);		theCheese = new cheese(100,100);		repaint();				while (true) {			mouse1.getCheese(theCheese);			mouse2.getCheese(theCheese);			Thread.yield();			/*try { Thread.sleep(5); }			catch (InterruptedException e) {}*/			repaint();		}	}			public void paint( Graphics g ) {		theCheese.draw(g);		mouse1.draw(g,theCheese);		mouse2.draw(g,theCheese);	}			public boolean mouseUp(Event e, int x, int y) {				theCheese.x = x;		theCheese.y = y;				return true;		}		public boolean mouseDrag(Event e, int x, int y) {				theCheese.x = x;		theCheese.y = y;				return true;		}		int distance(int x1,int y1,int x2,int y2) {		int xOff,yOff;		xOff = x1-x2;		yOff = y1-y2;		return (int)(Math.sqrt(xOff*xOff+yOff*yOff));	}	}class cheese {		int x,y;		cheese(int x,int y) {		this.x = x;		this.y = y;	}		void draw(Graphics g) {		g.setColor(new Color(255,150,0));		g.fillOval(x-5,y-5,12,12);		g.setColor(new Color(255,200,0));		g.fillOval(x-5,y-5,5,5);		g.fillOval(x,y-2,5,5);			}		}class mouse { 		int x,y,speed;		mouse(int x,int y,int speed) {		this.x = x;		this.y = y;		this.speed = speed;	}		void draw(Graphics g,cheese myCheese) {				g.setColor(Color.gray);		g.fillOval(x-10,y-10,20,20);		drawNose(g,myCheese);	}		void drawNose(Graphics g,cheese myCheese) {			int xOff,yOff,dist;		xOff = myCheese.x-x;		yOff = myCheese.y-y;		dist = (int)(Math.sqrt(xOff*xOff+yOff*yOff));				if (dist != 0) {			xOff = 10*xOff/dist;			yOff = 10*yOff/dist;		}		else {			xOff = 0;			yOff = 0;		}				g.setColor(Color.black);		g.fillOval(x+xOff-3,y+yOff-3,6,6);				}		void getCheese(cheese myCheese) {			int xOff,yOff,dist;		xOff = myCheese.x-x;		yOff = myCheese.y-y;		dist = (int)(Math.sqrt(xOff*xOff+yOff*yOff));				if (dist >= 13) {			x += speed*xOff/dist;			y += speed*yOff/dist;		}		else {			xOff = 0;			yOff = 0;		}									}		}				