This is my Code,
String f = txtFName.getText();
String l = txtLName.getText();
String c = txtCode.getText();
String p = txtPhone.getText();
String d = taDescribe.getText();
String t = txtDepartment.getText();
Object o = cbxOffice.getSelectedItem();
Object i = cbxImportance.getSelectedItem();
Object s = cbxStatus.getSelectedItem();
Object a = cbxAssignTo.getSelectedItem();
String r = taResolution.getText();
if (f != null && l != null && c != null && p != null && d != null &&
o != "--Select country--" && i != "--Select importance--" &&
i != "--Select importance--" && s != "--Select status--" &&
a != "--Select resource--")
// if (!(f == null || l == null || c == null || p == null || d == null &&
// o == "--Select country--" || i == "--Select importance--" ||
// i == "--Select importance--" || s == "--Select status--" ||
// a == "--Select resource--"))
// if (!(f == null || l == null || c == null || p == null || d == null))
{
// System.out.println("Complaint's Info: " + complaintObj.toString());
System.out.println("Complaint's info:" + "\n" + "First Name=" + "\t" +
f + "\n" + "Last Name=" + "\t" + l + "\n" + "Phone#=" + "\t" + c +
" " + p + "\n" + "Department=" + "\t" + t + "\n" + "Description:" +
"\t" + d + "\n" + "Office=" + "\t" + o + "\n" + "Importance=" +
"\t" + i + "\n" + "Status=" + "\t" + s + "\n" + "Assign to:" +
"\t" + a + "\n" + "Resolution=" + "\t" + r + "\n" + "Correct input!");
}
else
System.out.println("Incorrect input!");
JOptionPane.showMessageDialog(null,
"Missing input, please enter required info", "Input Error",
JOptionPane.ERROR_MESSAGE);
Cuty
|