Java JComboBox Model getNewDefaultComboBoxModel(ArrayList itemsToStream)

Here you can find the source of getNewDefaultComboBoxModel(ArrayList itemsToStream)

Description

Creates a new Default Combo Box Model from the ArrayList if items

License

Apache License

Parameter

Parameter Description
itemsToStream - the items to add to the model

Return

the new Default Combo Box Model populated with ArrayList items

Declaration

public static DefaultComboBoxModel getNewDefaultComboBoxModel(ArrayList<Class> itemsToStream) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;

import javax.swing.DefaultComboBoxModel;

public class Main {
    /**//from   w w w . j ava2 s . c  om
     * Creates a new Default Combo Box Model from the ArrayList if items
     * @param itemsToStream - the items to add to the model
     * @return the new Default Combo Box Model populated with ArrayList items
     */
    public static DefaultComboBoxModel getNewDefaultComboBoxModel(ArrayList<Class> itemsToStream) {
        DefaultComboBoxModel newModel = new DefaultComboBoxModel();

        itemsToStream.stream().forEach((c) -> {
            newModel.addElement(c);
        });

        return newModel;
    }
}

Related

  1. comboBoxContains(DefaultComboBoxModel model, Object obj)
  2. convertDefaultComboBoxModelToVector( DefaultComboBoxModel model)
  3. generateComboModel(Object[] values)
  4. generateInsertWhereComboBoxModel(String label)
  5. getComboModelList(ComboBoxModel model)
  6. getSelectedItemfromModel(Object combo)
  7. hasDataChanged(List newDatasets, ComboBoxModel currentModel)
  8. modelToList(DefaultComboBoxModel model)
  9. updateComboBoxModel(ComboBoxModel model, List values)