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.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;

public class Main {

    public static void initComboBoxModel(ComboBoxModel model, Object[] lista) {
        DefaultComboBoxModel defCombo = (DefaultComboBoxModel) model;
        defCombo.removeAllElements();
        for (Object o : lista) {
            defCombo.addElement(o);
        }
    }

    public static void initComboBoxModel(ComboBoxModel model, List lista) {
        DefaultComboBoxModel defCombo = (DefaultComboBoxModel) model;
        defCombo.removeAllElements();
        for (Object o : lista) {
            defCombo.addElement(o);
        }
    }
}