Here you can find the source of loadComboBox(JComboBox combo, List list)
public static void loadComboBox(JComboBox combo, List list)
//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); }); } }