[JAVA]JAVAの宿題・課題は俺に任せろ v1.004[JAVA]
■ このスレッドは過去ログ倉庫に格納されています
0201デフォルトの名無しさん
NGNGif (e.getSource().equals(addBtn)){
// retrive value from HTML document and assign it to a previously defined
// double variable named maxPayRate.
maxPayRate = Double.parseDouble(getParameter("maxRate"));
// Show an error message if employee name/pay rate are empty.
if (((nameField.getText()).equals(null)) || ((payRateField.getText()).equals(null)))
{msg.setText ("Please Enter the both Employee Name and Pay Rate Fields.");}
// Show an error message if the employee is already in the collection.
else if (m.containsKey(nameField.getText())){
msg.setText ("The Employee Name is already in the Collection.");}
// Show an error message if pay rate is greater than maxRate
else if ((Double.parseDouble(payRateField.getText())) > maxPayRate)
{msg.setText ("The Pay Rate is greater than max Pay Rate.");}
// Add the record into collection.
else{m.put(nameField.getText(), new Employee (nameField.getText(), Double.parseDouble(payRateField.getText())));
msg.setText("The Record has been added into the Collection.");}
}
■ このスレッドは過去ログ倉庫に格納されています