public void updateList() {
        listModel.clear();

        ArrayList<String> a = new ArrayList<>();
        for (Course co : aList) {
            if (co.getInstructor() == null && co.getLab() == null) {
                listModel.addElement(co.getClassCode() + "," + co.getSection() + " : " + "n/a");
            } else if (co.getInstructor() != null && co.getLab() != null) {
                a.add(co.getClassCode() + "," + co.getSection() + " : " + co.getInstructor().getName() + " (Lab)");
            } else if (co.getInstructor() != null && co.getLab() == null) {
                a.add(co.getClassCode() + "," + co.getSection() + " : " + co.getInstructor().getName());
            } else {
                listModel.addElement(co.getClassCode() + "," + co.getSection() + " : " + "n/a" + " (Lab)");
            }
        }
        Collections.sort(a);
        for (int i = 0; i < a.size(); i++) {
            listModel.add(i, a.get(i));
        }
    }