Java Reference
In-Depth Information
Display 17.19
A Simple Calculator (part 3 of 4)
79
}
80
else if (actionCommand.equals("Reset"))
81
{
82
result = 0.0;
83
ioField.setText("0.0");
84
}
85
else
86
ioField.setText("Unexpected error.");
87
}
88
//Throws NumberFormatException.
89
private static double stringToDouble(String stringObject)
90
{
91
return Double.parseDouble(stringObject.trim());
92
}
93
}
R ESULTING GUI (When started)
R ESULTING GUI (After entering 2,000)
(continued)
Search WWH ::




Custom Search