Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.ArrayList;
import java.util.List;

import javax.swing.ListModel;

public class Main {
    public static List<String> listModelToList(ListModel<String> modelo) {
        List<String> result = new ArrayList<>();

        for (int i = 0; i < modelo.getSize(); i++) {
            result.add(modelo.getElementAt(i));
        }

        return result;
    }
}