diff options
| author | EVE <EVE@EVE-PC> | 2017-03-14 12:07:14 -0400 |
|---|---|---|
| committer | EVE <EVE@EVE-PC> | 2017-03-14 12:07:14 -0400 |
| commit | 504ca816530efdff06bc202e0432ebd354aec304 (patch) | |
| tree | 4836932fb81d1d625470502c78c94d202c9a7420 /BJC-Utils2/src/main/java/bjc/utils/gui/SimpleJList.java | |
| parent | 5c1163df17c46f7d3e15b6c7949c38843ec56146 (diff) | |
Cleanup
Diffstat (limited to 'BJC-Utils2/src/main/java/bjc/utils/gui/SimpleJList.java')
| -rw-r--r-- | BJC-Utils2/src/main/java/bjc/utils/gui/SimpleJList.java | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/BJC-Utils2/src/main/java/bjc/utils/gui/SimpleJList.java b/BJC-Utils2/src/main/java/bjc/utils/gui/SimpleJList.java index 0cac1c9..e469f2f 100644 --- a/BJC-Utils2/src/main/java/bjc/utils/gui/SimpleJList.java +++ b/BJC-Utils2/src/main/java/bjc/utils/gui/SimpleJList.java @@ -6,43 +6,39 @@ 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 <E> * 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 <E> JList<E> buildFromList(Iterable<E> source) { - if (source == null) { - throw new NullPointerException("Source must not be null"); - } + 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 <E> * 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 <E> ListModel<E> buildModel(Iterable<E> source) { - if (source == null) { - throw new NullPointerException("Source must not be null"); - } + if(source == null) throw new NullPointerException("Source must not be null"); DefaultListModel<E> defaultModel = new DefaultListModel<>(); |
