Java tutorial
//package com.java2s; import java.util.List; import javax.swing.DefaultListModel; public class Main { public static DefaultListModel list2ListModel(List<? extends Object> list) { DefaultListModel model = new DefaultListModel(); if (list != null) { for (Object o : list) { model.addElement(o); } } return model; } }