I am working on a course project and I ran into an issue while making the program in netbeans. I coded the program in blueJ and everything worked fine there but whenever I moved everything to netbeans and I ran into a few issues. Here is the main method: Note: There was some other code there, but it does not show up in the netbeans so I just left it out. But it is still in java file.
/**
* @param args the command line arguments
*/
public static void main(String args[]) throws IOException {
StudentInfo myStudents = new StudentInfo();
myStudents.open("students.dat");
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new NewJFrame().setVisible(true);
}
});
}
Here is where I get the error:
myStudent.writeStudent(myStudents);
says it cannot find the symbol myStudents.
Finally here is the writeStudents
public void writeStudent(Student inS) throws IOException
{
int n = inS.getStudentID() - 901000000;
students.seek(n * RECORD_SIZE);
students.writeInt(inS.getStudentID());
String lastName = padString(inS.getLastName());
for (int i=0; i < STRING_SIZE; i++)
students.writeChar(lastName.charAt(i));
String firstName = padString(inS.getFirstName());
for (int i=0; i<STRING_SIZE; i++)
students.writeChar(firstName.charAt(i));
String address = padString(inS.getAddress());
for(int i=0; i<STRING_SIZE; i++)
students.writeChar(address.charAt(i));
students.writeDouble(inS.getWageRate());
students.writeDouble(inS.getHoursWorked());
}