JComboBox
いくつかの従業員ID番号(整数値)を含むがあります。
「従業員の選択」をデフォルト値としてJComboBoxに設定したいと思います。この値は文字列形式であるため、「java.lang.NumberFormatException:入力文字列の場合:「SelectEmployee」」のような例外がスローされます。どうすればよいですか?
私のコードは次のとおりです。
public void clear()
{
cmb_emp_id.setSelectedItem("Select Employee");
txt_emp_name.setText("");
txt_department.setText("");
txt_designation.setText("");
joining_date.setDate(new Date());
resign_date.setDate(new Date());
txt_description.setText("");
}
どうすればこれを達成できますか?