Java tutorial
//package com.java2s; import java.util.List; import javax.swing.AbstractListModel; import javax.swing.DefaultListModel; public class Main { /** * * @param lista * @return */ public static AbstractListModel initListModel(List lista) { DefaultListModel<String> model = new DefaultListModel<>(); for (Object item : lista) { model.addElement(item.toString()); } return model; } }