Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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;
    }
}