Problem returning Array values Please help
I am trying to return my array values but cant seem to get them to display. Can someone please point me in the right direction.
Code:
private void EnterActionPerformed(java.awt.event.ActionEvent evt) {
// Enter Button functionality
Scanner input = new Scanner(System.in);
try{
//convert text input to integer for array
int timeInt = Integer.parseInt(timeField.getText());
//input array values in a loop
for (index = 0; index > 0; index++)
{
tarray[index][0] = input.nextInt(timeInt);
}
index++;
}
catch (Exception e) {
JOptionPane.showMessageDialog(this, "Invalid Input in the Time field","ERROR",JOptionPane.ERROR_MESSAGE);
return;
}
try{
//convert text input to integer for array
int moneyInt = Integer.parseInt(moneyField.getText());
//input array values in a loop
for (index = 0; index > 0; index++)
{
tarray[index][1] = input.nextInt(moneyInt);
}
index++;
//resets the text fields for new values
// moneyField.setText("");
// timeField.setText("");
[COLOR="Red"]reportArea.append("money is at" + " " + tarray[index][1]);
reportArea.append(" " + "time is at" + " " + tarray[index][0]);[/COLOR] }
catch (Exception e) {
JOptionPane.showMessageDialog(this, "Invalid Input in the Money field","ERROR",JOptionPane.ERROR_MESSAGE);
return;
}
}
[COLOR="Red"] private void runReportActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
String tutorOutPut = Double.toString(tarray[0][0]);
String tutorOutput2 = Double.toString(tarray[0][1]);
reportArea.append(tutorOutPut + " " + tutorOutput2);[/COLOR] }
private void quitActionPerformed(java.awt.event.ActionEvent evt) {
// Exit program
System.exit(0);
}