combobox의 값이 선택되었는지 여부를 콤보 상자에서 간단하게 확인하고 있지만 두 번째 조건이 참이면 알림이 표시되지 않고 첫 번째 조건이 참이면 알림이 여기에 표시됩니다 코드입니다.
if(cboContactType.getValue() == null || cboCountry.getValue() == null){
Notification.show("Contact type and country can't be empty");
} else if(cboContactType.getValue().equals("Email")) {
if(txtEmail.getValue() == null) {
Notification.show("Email can'nt be empty");
}
}
실수가 무엇인지 말해주세요. 감사 :)
if(cboContactType.getValue() == null || cboContactType.getValue().equals("") || cboCountry.getValue() == null || cboCountry.getValue().equals("")){
또는 디버그 (또는 간단히 System.out.println ( "Value is :"+ cboContactType.getValue ());를 코드에 추가하면 실제 값이 표시됩니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다