Here you can find the source of modelToList(DefaultComboBoxModel model)
public static List<String> modelToList(DefaultComboBoxModel model)
//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; } }