if (components[i] instanceof JComboBox) list.add(teachers[((JComboBox)components[i]).getSelectedIndex()]);
if (components[i] instanceof JComboBox) { int index = ((JComboBox)components[i]).getSelectedIndex(); if (index > 0) list.add(teachers[index]); }
	public Collection getTeachers() {		ArrayList list = new ArrayList();				if (teachersName != null) {			Component[] components = teacherPanel.getComponents();						for(int i = 0; i < components.length; ++i) {			    if (components[i] instanceof JComboBox)			        list.add(teachers[((JComboBox)components[i]).getSelectedIndex()]);			}		}				return list;	}