Java JComboBox Model modelToList(DefaultComboBoxModel model)

Here you can find the source of modelToList(DefaultComboBoxModel model)

Description

model To List

License

Apache License

Declaration

public static List<String> modelToList(DefaultComboBoxModel model) 

Method Source Code


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

import java.util.ArrayList;

import java.util.List;

import javax.swing.DefaultComboBoxModel;

public class Main {
    public static List<String> modelToList(DefaultComboBoxModel model) {
        List<String> elements = new ArrayList<String>();
        for (int i = 0; i < model.getSize(); i++) {
            elements.add((String) model.getElementAt(i));
        }//  w  w w  .  j  av  a  2s . c  o m
        return elements;
    }
}

Related

  1. generateInsertWhereComboBoxModel(String label)
  2. getComboModelList(ComboBoxModel model)
  3. getNewDefaultComboBoxModel(ArrayList itemsToStream)
  4. getSelectedItemfromModel(Object combo)
  5. hasDataChanged(List newDatasets, ComboBoxModel currentModel)
  6. updateComboBoxModel(ComboBoxModel model, List values)
  7. updateComboBoxModel(final JComboBox aComboBox, final Vector aValues)