title: How can I check if jcombobox selection has not been selected?
body: <pre><code>comboGender.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Male", "Female" }));
  comboCivilStatus.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Single", "Married", "Widow / Widower", "Divorced" }));
  
  
  if(txtAddress.getText().trim().equals("")){
          JOptionPane.showMessageDialog(null, "INVALID ADDRESS");
  }else if(comboGender.getSelectedItem().toString().equals("")){
          JOptionPane.showMessageDialog(null, "SELECT A GENDER");
  }else if(comboCivilStatus.getSelectedItem().toString().equals("")){
          JOptionPane.showMessageDialog(null, "SELECT A CIVIL STATUS");
  }
  </code></pre>
  
  <p><strong>*just a portion of my code *</strong></p>
  
  <p>hello stackoverflow. i am new here. and i am also a novice in java programming. i seem to be having a problem that i cannot figured out how solve.</p>
  
  <p>i am trying to make if and else if statements to check whether my textfields and comboboxes are empty. and then trying to return a showMessageDialog telling me to input something. i already figured out how to do the textboxes. but the combobox i cannot seem to understand how to do the syntax. can anyone please help? thank you.</p>
  
  <p>by the way i am using java netbeans.</p>