When I pressed enter and put in "32" in the red input, the scenario had a run time error (stopped), but I don't know what's the cause because it works just fine in editing.
I think you are required to key a number in for the other color parts (at least zeroes, if that is the value you want for them). You could programmatically account for an empty return string. I do not know if setting a default '0' value for the inputs would be enough.
After asking for the red number, it should ask for green number, than blue. Even if I put in an abstract character like '~,' in editing, I won't get the error message until after all three questions have popped up. Here, if I put anything in, the scenario will crash. There is no terminal, so I don't know the error.
Some of my code:
String r = JOptionPane.showInputDialog("Red number:");
for (int x = 0; x < r.length(); x++) {
char i = r.charAt(x);
if (Character.isAlphabetic(i)) {
JOptionPane.showMessageDialog(null, "Must be numeric!");
return;
}
if (x >= 3) {
JOptionPane.showMessageDialog(null, "Too long!");
return;
}
}
2014/8/5
2014/8/5
2014/8/5
2014/8/5
2014/8/5
2014/8/5