for(int i=0; i<nbteachers;i++) { list.add(((JComboBox)components[i]).getSelectedItem().toString());
for (int i = 0; i < components.length; ++i) { if (components[i] instanceof JTextField) list.add(((JTextField)components[i]).getText());
	public Collection getNameGroups() {				int nbteachers = nameGroupJtfPanel.getComponentCount();				ArrayList list = new ArrayList();		Component [] components = nameGroupJtfPanel.getComponents();				for(int i=0; i<nbteachers;i++) {			list.add(((JComboBox)components[i]).getSelectedItem().toString());		}				return list;	}