Java JComboBox loadComboBox(JComboBox combo, List list)

Here you can find the source of loadComboBox(JComboBox combo, List list)

Description

load Combo Box

License

Open Source License

Declaration

public static void loadComboBox(JComboBox combo, List list) 

Method Source Code

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

import java.util.List;

import javax.swing.JComboBox;

public class Main {
    public static void loadComboBox(JComboBox combo, List list) {
        loadComboBox(combo, list, true);
    }//from  w  ww  . ja v  a 2s.c om

    public static void loadComboBox(JComboBox combo, List list, boolean removeAll) {
        if (removeAll) {
            combo.removeAllItems();
        }

        list.stream().forEach((object) -> {
            combo.addItem(object);
        });
    }
}

Related

  1. isCbEquals(JComboBox cb, String str)
  2. isComboBoxButton(AbstractButton button)
  3. isEmptyStr(javax.swing.JComboBox input)
  4. isJComboBoxNotEmpty(javax.swing.JComboBox combo)
  5. largeThan(javax.swing.JComboBox input, double x)
  6. loadEnum(JComboBox combo, Class c, boolean removeAll)
  7. loadPrefs(Preferences prefs, String prefKey, JComboBox combo)
  8. makeJComboBox(ResourceBundle resource, String panelName, String keyword)
  9. makeSquare(JComboBox... comboBoxes)