i am facing a problem running this code !_NEWLINE_!giving 3 errors about runner class!_NEWLINE_!plz help me in fixing it
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   adnan_tariq
Posted On:   Tuesday, November 20, 2001 05:50 PM

import java.awt.*; public class RaceApplet extends java.applet.Applet implements Runnable { final static int NUMRUNNERS = 2; final static int SPACING = 20; Runner[] runners = new Runner[NUMRUNNERS]; Thread updateThread = null; public void init() { String raceType = getParameter("type"); for (int i = 0; i < NUMRUNNERS; i++) { runners[i] = new Runner(); if (raceType.compareTo("unfair") == 0) runners[i].setPriority(i+2); else runners[i].setPriority(2); } if (updateThread == null) { updateThread = new Thread(this, "Thread Race"); updateThread.setPriority(NUMRUNNERS+2);    More>>
			
import java.awt.*;

public class RaceApplet extends java.applet.Applet implements Runnable {

final static int NUMRUNNERS = 2;
final static int SPACING = 20;

Runner[] runners = new Runner[NUMRUNNERS];

Thread updateThread = null;

public void init() {
String raceType = getParameter("type");
for (int i = 0; i < NUMRUNNERS; i++) {
runners[i] = new Runner();
if (raceType.compareTo("unfair") == 0)
runners[i].setPriority(i+2);
else
runners[i].setPriority(2);
}
if (updateThread == null) {
updateThread = new Thread(this, "Thread Race");
updateThread.setPriority(NUMRUNNERS+2);
}
}
   <<Less

Re: i am facing a problem running this code !_NEWLINE_!giving 3 errors about runner class!_NEWLINE_!plz help me in fixing it

Posted By:   Alex_Chaffee  
Posted On:   Thursday, November 29, 2001 09:29 AM

OK, first, FAQ Forums are not a very efficient way to get help debugging your code.



Second, how do you expect anyone to help you debug if you don't say what the errors are?


Finally, you should have used the

 tag around your code (I added it for you this time) -- kind of hard to read otherwise.
About | Sitemap | Contact