Here you can find the source of loadEnum(JComboBox combo, Class
public static <E extends Enum<E>> void loadEnum(JComboBox combo, Class<E> c, boolean removeAll)
//package com.java2s; //License from project: Open Source License import javax.swing.JComboBox; public class Main { public static <E extends Enum<E>> void loadEnum(JComboBox combo, Class<E> c) { loadEnum(combo, c, true);// w ww . jav a2 s. c om } public static <E extends Enum<E>> void loadEnum(JComboBox combo, Class<E> c, boolean removeAll) { if (removeAll) { combo.removeAllItems(); } for (E e : c.getEnumConstants()) { combo.addItem(e); } } }