Hi,
I'm having problems with creating a dialog box.
I want to create a dialog box to basically inform the user of the error in their input (ex. Non-numerical input).
Quote:
public double getX1Input () {
double dblX1 = 0;
while (true) {
try {
dblX1 = checkNegativeZero(Double.parseDouble(txtX1.getText()));
break;
}
catch (NumberFormatException e) {
//JOptionPane.showMessageDialog(frame, "Eggs are not supposed to be green.");
JButton buttonOK = new JButton("OK");
JOptionPane.showMessageDialog(buttonOK, JOptionPane.INFORMATION_MESSAGE);
}
}
return dblX1;
}
There is an error on the JOptionPane.showMessageDialog line.
If anyone could help me out with this, it would be greatly appreciated.
Thanks in advance.