OK, the code so far is...
import java.util.*;
import javax.swing.*;
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int gen, tally, num1;
double dice = Double.parseDouble(jTextField1.getText());
double thresh = Double.parseDouble(jTextField2.getText());
double again = Double.parseDouble(jTextField3.getText());
gen=(0);
tally=(0);
{num1 = (int) ((Math.random() * 10) + 1);
{gen ++;}
while (gen<dice)
{if (num1>=again)
{dice ++;
tally ++;}
else
if (num1>=thresh)
{tally++;}
else
if (num1<thresh)
jTextField4.setText(String.valueOf(tally));
}
}
}
As you might be able to tell, I'm attempting to run this in a GUI, because Net Beans makes it very easy to do GUI work. i have for simplicities sake left the GUI code out. That being said, I was able to successfully compile the program, but when i attempted to run it, with variables in all necessary fields, the program lagged heavily and the error "java.lang.NullPointerException" popped up in the output dialog box in Net Beans.
Any ideas are always welcome.
Thank You,
Cribbageman