Java JComboBox CargarComboBox(JComboBox cb, List lista)

Here you can find the source of CargarComboBox(JComboBox cb, List lista)

Description

Cargar Combo Box

License

Open Source License

Declaration

public static <T> void CargarComboBox(JComboBox cb, List<T> lista) 

Method Source Code

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

import java.util.List;
import java.util.Vector;

import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;

public class Main {
    public static <T> void CargarComboBox(JComboBox cb, List<T> lista) {
        Vector<T> v = new Vector<T>();
        for (T p : lista) {
            v.add(p);//  www . ja v  a2s .  c  om
        }
        cb.setModel(new DefaultComboBoxModel<T>(v));
    }
}

Related

  1. addToComboBox(JComboBox list, Object object)
  2. adjustComboBoxHeight(JComboBox comboBox)
  3. adjustPopupWidth(JComboBox comboBox)
  4. adjustSize(JComboBox comboBox)
  5. applyDefaultProperties(final JComboBox comp)
  6. checkJComboBoxNotEmpty(javax.swing.JComboBox combo, javax.swing.JLabel promptName, ArrayList errors)
  7. comboBoxScroll(JComboBox box)
  8. comboContainsElement(JComboBox combo, String element)
  9. contains(JComboBox jcb, Object o, boolean caseSensitive)