From c82e3b3b2de0633317ec8fc85925e91422820597 Mon Sep 17 00:00:00 2001 From: "Benjamin J. Culkin" Date: Sun, 8 Oct 2017 22:39:59 -0300 Subject: Start splitting into maven modules --- .../src/main/java/bjc/utils/gui/SimpleJList.java | 49 ---------------------- 1 file changed, 49 deletions(-) delete mode 100644 BJC-Utils2/src/main/java/bjc/utils/gui/SimpleJList.java (limited to 'BJC-Utils2/src/main/java/bjc/utils/gui/SimpleJList.java') diff --git a/BJC-Utils2/src/main/java/bjc/utils/gui/SimpleJList.java b/BJC-Utils2/src/main/java/bjc/utils/gui/SimpleJList.java deleted file mode 100644 index 411d0db..0000000 --- a/BJC-Utils2/src/main/java/bjc/utils/gui/SimpleJList.java +++ /dev/null @@ -1,49 +0,0 @@ -package bjc.utils.gui; - -import javax.swing.DefaultListModel; -import javax.swing.JList; -import javax.swing.ListModel; - -/** - * Utility class for making JLists and their models. - * - * @author ben - * - */ -public class SimpleJList { - /** - * Create a new JList from a given list. - * - * @param - * The type of data in the JList - * - * @param source - * The list to populate the JList with. - * @return A JList populated with the elements from ls. - */ - public static JList buildFromList(final Iterable source) { - if (source == null) throw new NullPointerException("Source must not be null"); - - return new JList<>(buildModel(source)); - } - - /** - * Create a new list model from a given list. - * - * @param - * The type of data in the list model - * - * @param source - * The list to fill the list model from. - * @return A list model populated with the elements from ls. - */ - public static ListModel buildModel(final Iterable source) { - if (source == null) throw new NullPointerException("Source must not be null"); - - final DefaultListModel defaultModel = new DefaultListModel<>(); - - source.forEach(defaultModel::addElement); - - return defaultModel; - } -} -- cgit v1.2.3