ユーザーがハッシュマップの更新を決定したときに、コードが正しく更新されないという問題が発生しています。私のコードの更新セクションでは、この新しい入力でハッシュマップが更新されない
if(comboBoxSelection == "Update"){
String gradeValue= (String) JOptionPane.showInputDialog(null, "Choose Grades: ", "", JOptionPane.INFORMATION_MESSAGE, null, grades, "");
String creditAmount= (String) JOptionPane.showInputDialog(null, "Choose Credit: ", "", JOptionPane.INFORMATION_MESSAGE, null, credits, "");
studentObj.courseCompleted(gradeValue.charAt(0), Integer.parseInt(creditAmount));
studentDatabase.put(iD, studentObj);
}//end update combobox selection
およびそれらの変更を受け入れる方法であり、私はより多くのコードを投稿する必要がある場合
public void courseCompleted(char courseGrade, int creditHours){
if (courseGrade == 'A'){
totalCredit = 4;
totalQuailtyPoints = (totalCredit * creditHours);
}//end course grade A
if(courseGrade == 'B'){
totalCredit = 3;
totalQuailtyPoints = (totalCredit * creditHours);
}//end course grade B
if(courseGrade == 'C'){
totalCredit = 2;
totalQuailtyPoints = (totalCredit * creditHours);
}//end course grade C
if(courseGrade == 'D'){
totalCredit = 1;
totalQuailtyPoints = (totalCredit * creditHours);
}//end course grade D
if(courseGrade == 'F'){
totalCredit = 0;
totalQuailtyPoints = (totalCredit * creditHours);
}//end course grade F
}//end courseCompleted method
である私は技術的に