Here you can find the source of add(final DefaultListModel
Parameter | Description |
---|---|
model | a parameter |
collection | a parameter |
public static void add(final DefaultListModel<Object> model, final Collection<Object> collection)
//package com.java2s; /******************************************************************************* * Manchester Centre for Integrative Systems Biology * University of Manchester/*from ww w . j a va 2s.c o m*/ * Manchester M1 7ND * United Kingdom * * Copyright (C) 2007 University of Manchester * * This program is released under the Academic Free License ("AFL") v3.0. * (http://www.opensource.org/licenses/academic.php) *******************************************************************************/ import java.util.*; import javax.swing.*; public class Main { /** * * @param model * @param collection */ public static void add(final DefaultListModel<Object> model, final Collection<Object> collection) { model.clear(); for (Iterator<Object> iterator = collection.iterator(); iterator.hasNext();) { model.addElement(iterator.next()); } } /** * * @param model * @param array */ public static void add(final DefaultListModel<Object> model, final Object[] array) { add(model, Arrays.asList(array)); } }