Here you can find the source of checkJComboBoxNotEmpty(javax.swing.JComboBox
public static void checkJComboBoxNotEmpty(javax.swing.JComboBox<String> combo, javax.swing.JLabel promptName, ArrayList<String> errors)
//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(); } }