Java JComboBox Item loadCombo(JComboBox cmb, List data)

Here you can find the source of loadCombo(JComboBox cmb, List data)

Description

load Combo

License

Open Source License

Declaration

public static void loadCombo(JComboBox cmb, List data) 

Method Source Code

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

import java.util.Iterator;
import java.util.List;

import javax.swing.JComboBox;

public class Main {
    public static void loadCombo(JComboBox cmb, List data) {
        cmb.addItem(" ");
        if (data != null) {
            Iterator it = data.iterator();
            while (it.hasNext()) {
                cmb.addItem(it.next());/*from   w  ww. java 2  s . c  om*/
            }
        }
    }
}

Related

  1. getDataIndexFromComboBox(JComboBox cbb, String dta)
  2. getItems(JComboBox box)
  3. getItems(JComboBox comboBox)
  4. insertIntoCombo(JComboBox combo, Object item)
  5. items(JComboBox comboBox)
  6. loadInstances(JComboBox target, Class source, Class limit, Object defaultItem)
  7. loadStaticItems(JComboBox target, Class source, Class limit, String defaultItem)
  8. makeComboBox(Object[] items)
  9. replaceComboContents(JComboBox cb, String[] items)