I am getting an error when trying to run my code in Java. I am trying to run an output to a file where the user uses dialog boxes to input name, pay rate, and hours worked.
This is the code I have:
package output.to.a.file.broc.east;
import javax.swing.JOptionPane;
public class OutputToAFileBrocEast
{
public static void main(String[] args)
{
OutputFile payFile;
payFile = new OutputFile ("payroll.txt");
String name;
String rate;
String hours;
String answer;
do
{
int number1;
int number2;
name = JOptionPane.showInputDialog("Enter first and last name: ");
rate = JOptionPane.showInputDialog("Enter hourly rate: ");
hours = JOptionPane.showInputDialog("Enter hours for previous week: ");
number1 = Integer.parseInt (rate);
number2 = Integer.parseInt (hours);
payFile.writeWord(name);
payFile.writeWord(rate);
payFile.writeWord(hours);
payFile.writeEOL();
answer = JOptionPane.showInputDialog("Do you have another employee? [y/n");
}
while (answer.equalsIgnoreCase ("yes"));
}
}
But I get this error when trying to run the code:
Error: Could not find or load main class output.to.a.file.broc.east.OutputToAFileBrocEast
Java Result: 1
I am using Netbeans 7.4
. and I have already attempted to delete the netbeans cache.