Java JComboBox checkJComboBoxNotEmpty(javax.swing.JComboBox combo, javax.swing.JLabel promptName, ArrayList errors)

Here you can find the source of checkJComboBoxNotEmpty(javax.swing.JComboBox combo, javax.swing.JLabel promptName, ArrayList errors)

Description

check J Combo Box Not Empty

License

Open Source License

Declaration

public static void checkJComboBoxNotEmpty(javax.swing.JComboBox<String> combo, javax.swing.JLabel promptName,
            ArrayList<String> errors) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;

public class Main {
    public static void checkJComboBoxNotEmpty(javax.swing.JComboBox<String> combo, javax.swing.JLabel promptName,
            ArrayList<String> errors) {
        if (!isJComboBoxNotEmpty(combo))
            errors.add(promptName.getText());
    }/*from  ww  w .ja  v a2  s.  c  om*/

    public static boolean isJComboBoxNotEmpty(javax.swing.JComboBox<String> combo) {
        return !((String) combo.getSelectedItem()).trim().isEmpty();
    }
}

Related

  1. adjustComboBoxHeight(JComboBox comboBox)
  2. adjustPopupWidth(JComboBox comboBox)
  3. adjustSize(JComboBox comboBox)
  4. applyDefaultProperties(final JComboBox comp)
  5. CargarComboBox(JComboBox cb, List lista)
  6. comboBoxScroll(JComboBox box)
  7. comboContainsElement(JComboBox combo, String element)
  8. contains(JComboBox jcb, Object o, boolean caseSensitive)
  9. createLabelCombo(String label, JComboBox comboBox)