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