pls help screwy problem with this code
Im pretty new to java, and I'm trying to make a MASH program to practice. I cant figure out this error, as it checks out with some examples from a book. Please help!
When compiling in the command prompt, this is what the errors are:
cannot resolve symbol
symbol: class MashBuild
location: class MashEvent
MashBuild gui;
^
cannot resolve symbol
symbol: class MashBuild
location: class MashEvent
public MashEvent(MashBuild in) {
^
Here is the code for MashEvent.java-- I also have a class called MashBuild that has the code for the display of the program and all of the JButtons, etc. so I dont see why this shouldn't work
import javax.swing.*;
import java.awt.event.*;
publicclass MashEventimplements ActionListener, Runnable{
MashBuild gui;
Thread playing;
public MashEvent(MashBuild in){
gui = in;
}
publicvoid actionPerformed(ActionEvent event){
String command = event.getActionCommand();
if (command =="Play")
startPlaying();
if (command =="Reset")
clearAllFields();
}
void startPlaying(){
playing =new Thread(this);
playing.start();
gui.play.setEnabled(false);
gui.reset.setEnabled(true);
}
void clearAllFields(){
for (int i = 0; i < 10; i++){
gui.houses[i].setText(null);
gui.cars[i].setText(null);
gui.people[i].setText(null);
gui.kids[i].setText(null);
}
gui.houseTR.setText(null);
gui.carTR.setText(null);
gui.peopleTR.setText(null);
gui.kidTR.setText(null);
}
publicvoid run(){
Thread thisThread = Thread.currentThread();
while (playing == thisThread){
int choice;
choice = (int)Math.floor(Math.random() * 10);
if (choice != 40){
gui.houseTR.setText(gui.houses[0].value);
gui.carTR.setText(gui.cars[0].value);
gui.peopleTR.setText(gui.people[0].value);
gui.kidTR.setText(gui.kids[0].value);
}
try{
Thread.sleep(100);
}catch(InterruptedException e){}
}
}
}

