intitleFieldJtf = new TextFieldBoT(40); addComponent(AMFWLayout,layoutConstraints,intitleFieldJtf,4,4,3,1,1.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.HORIZONTAL,new Insets(20,10,15,10)); AMFWFrame.getContentPane().add(intitleFieldJtf);
intituleFieldJtf = new TextFieldBoT(40); addComponent(AMFWLayout,layoutConstraints,intituleFieldJtf,4,4,3,1,1.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.HORIZONTAL,new Insets(20,10,15,10)); AMFWFrame.getContentPane().add(intituleFieldJtf);
    private void initAddModifyFieldWindow() {        JLabel formationFieldLabel = new JLabel("Formation Correspondante :");    	addComponent(AMFWLayout,layoutConstraints,formationFieldLabel,1,1,4,1,0.0,0.0,GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(20,10,0,10));    	AMFWFrame.getContentPane().add(formationFieldLabel);    	    	if (formation != null) {    	    JLabel formationValue = new JLabel(formation.getHeading());	    	addComponent(AMFWLayout,layoutConstraints,formationValue,5,1,GridBagConstraints.REMAINDER,1,1.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.HORIZONTAL,new Insets(20,10,0,10));	    	AMFWFrame.getContentPane().add(formationValue);    	} else {            Collection tmp = MainFrame.getInstance().getUserConnected().getFormationsInCharge();            formationsName = new String[tmp.size()+1];            formations = new Formation[tmp.size()+1];            formationsName[0] = "";            int j = 1;            for (Iterator i = tmp.iterator(); i.hasNext(); ++j) {                formations[j] = (Formation) i.next();                formationsName[j] = formations[j].getHeading();            }            formationFieldJcb = new JComboBox(formationsName);	    	addComponent(AMFWLayout,layoutConstraints,formationFieldJcb,5,1,4,1,1.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.HORIZONTAL,new Insets(0,10,0,10));	    	AMFWFrame.getContentPane().add(formationFieldJcb);    	}    	    	JLabel teacherFieldLabel = new JLabel("Enseignant responsable :");    	addComponent(AMFWLayout,layoutConstraints,teacherFieldLabel,1,3,4,1,0.0,0.0,GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(30,10,15,10));    	AMFWFrame.getContentPane().add(teacherFieldLabel);    	    	if (teacher != null) {    	    JLabel teacherValue = new JLabel(teacher.getName()+" "+teacher.getFirstName());	    	addComponent(AMFWLayout,layoutConstraints,teacherValue,5,3,GridBagConstraints.REMAINDER,1,1.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.HORIZONTAL,new Insets(20,10,0,10));	    	AMFWFrame.getContentPane().add(teacherValue);    	} else {	    	try {	            Collection t = DaoManager.getUserDao().getTeachers();	            teachersName = new String[t.size()+1];	            teachers = new User[t.size()+1];	            teachersName[0] = "";	            int j = 1;	            for (Iterator i = t.iterator(); i.hasNext(); ++j) {	                teachers[j] = (User) i.next();	                teachersName[j] = teachers[j].getName() + " " + teachers[j].getFirstName();	            }	            teacherFieldJcb = new JComboBox(teachersName);	        } catch (Exception e) {	            JLabel label = new JLabel("Erreur lors de la rcupration des enseignants");	            label.setForeground(Color.RED);	            addComponent(AMFWLayout,layoutConstraints,label,5,2,4,1,1.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.HORIZONTAL,new Insets(20,10,15,10));	            AMFWFrame.getContentPane().add(label);	            teacherFieldLabel.setEnabled(false);	            teacherFieldJcb = new JComboBox();	            teacherFieldJcb.setEnabled(false);	        }	    	addComponent(AMFWLayout,layoutConstraints,teacherFieldJcb,5,3,4,1,1.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.HORIZONTAL,new Insets(20,10,15,10));	    	AMFWFrame.getContentPane().add(teacherFieldJcb);    	}    	    	    	JLabel intitleFieldLabel = new JLabel("Intitul de la matire :");    	addComponent(AMFWLayout,layoutConstraints,intitleFieldLabel,1,4,3,1,0.0,0.0,GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(15,10,15,10));    	AMFWFrame.getContentPane().add(intitleFieldLabel);    	    	intitleFieldJtf = new TextFieldBoT(40);   	    	addComponent(AMFWLayout,layoutConstraints,intitleFieldJtf,4,4,3,1,1.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.HORIZONTAL,new Insets(20,10,15,10));    	AMFWFrame.getContentPane().add(intitleFieldJtf);    	    	    	    	JLabel hourCourseFieldLabel = new JLabel("Nombre d'heures de cours :");    	addComponent(AMFWLayout,layoutConstraints,hourCourseFieldLabel,1,5,4,1,0.0,0.0,GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(15,10,15,10));    	AMFWFrame.getContentPane().add(hourCourseFieldLabel);    	    	    	JLabel magistrauxLabel = new JLabel("Magistraux");    	addComponent(AMFWLayout,layoutConstraints,magistrauxLabel,2,6,1,1,0.0,0.0,GridBagConstraints.EAST,GridBagConstraints.NONE,new Insets(15,10,15,10));    	AMFWFrame.getContentPane().add(magistrauxLabel);    	    	magistrauxJcb = new JComboBox();    	initNumberJcb(magistrauxJcb, 0, 300);    	magistrauxJcb.addItemListener(new ItemListener(){			public void itemStateChanged(ItemEvent e) {								if ( (((JComboBox)e.getSource()).getSelectedIndex() == 0) && (courseMPanel.getComponentCount() != 0)) {										courseMPanel.removeAll();					AMFWFrame.getContentPane().remove(courseMPanel);					AMFWFrame.pack();				}								if((((JComboBox)e.getSource()).getSelectedIndex() != 0) && (courseMPanel.getComponentCount() == 0)) {					initTypeCoursePanel(courseMPanel, 1);			    	addComponent(AMFWLayout,layoutConstraints,courseMPanel,1,7,8,1,0.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.HORIZONTAL,new Insets(5,10,15,10));			    	AMFWFrame.getContentPane().add(courseMPanel);			    	AMFWFrame.pack();				}			}    		    	});    	addComponent(AMFWLayout,layoutConstraints,magistrauxJcb,3,6,1,1,0.0,0.0,GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(5,10,15,10));    	AMFWFrame.getContentPane().add(magistrauxJcb);    	    	JLabel tdLabel = new JLabel("TD");    	addComponent(AMFWLayout,layoutConstraints,tdLabel,5,6,1,1,0.0,0.0,GridBagConstraints.EAST,GridBagConstraints.NONE,new Insets(15,10,15,10));    	AMFWFrame.getContentPane().add(tdLabel);    	    	tdJcb = new JComboBox();    	initNumberJcb(tdJcb, 0, 300);    	tdJcb.addItemListener(new ItemListener(){			public void itemStateChanged(ItemEvent e) {								if ( (((JComboBox)e.getSource()).getSelectedIndex() == 0) && (tdPanel.getComponentCount() != 0)) {										tdPanel.removeAll();					AMFWFrame.getContentPane().remove(tdPanel);					AMFWFrame.pack();				}								if((((JComboBox)e.getSource()).getSelectedIndex() != 0) && (tdPanel.getComponentCount() == 0)) {					initTypeCoursePanel(tdPanel, 2);			    	addComponent(AMFWLayout,layoutConstraints,tdPanel,1,8,9,1,0.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.HORIZONTAL,new Insets(5,10,15,10));			    	AMFWFrame.getContentPane().add(tdPanel);			    	AMFWFrame.pack();				}			}    		    	});    	addComponent(AMFWLayout,layoutConstraints,tdJcb,6,6,1,1,0.0,0.0,GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(5,10,15,10));    	AMFWFrame.getContentPane().add(tdJcb);    	    	JLabel tpLabel = new JLabel("TP");    	addComponent(AMFWLayout,layoutConstraints,tpLabel,7,6,1,1,0.0,0.0,GridBagConstraints.EAST,GridBagConstraints.NONE,new Insets(15,10,15,10));    	AMFWFrame.getContentPane().add(tpLabel);    	    	tpJcb = new JComboBox();    	initNumberJcb(tpJcb, 0, 300);    	tpJcb.addItemListener(new ItemListener(){			public void itemStateChanged(ItemEvent e) {								if ( (((JComboBox)e.getSource()).getSelectedIndex() == 0) && (tpPanel.getComponentCount() != 0)) {										tpPanel.removeAll();					AMFWFrame.getContentPane().remove(tpPanel);					AMFWFrame.pack();				}								if((((JComboBox)e.getSource()).getSelectedIndex() != 0) && (tpPanel.getComponentCount() == 0)) {					initTypeCoursePanel(tpPanel, 3);			    	addComponent(AMFWLayout,layoutConstraints,tpPanel,1,9,9,1,0.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.HORIZONTAL,new Insets(5,10,15,10));			    	AMFWFrame.getContentPane().add(tpPanel);			    	AMFWFrame.pack();				}			}    		    	});    	addComponent(AMFWLayout,layoutConstraints,tpJcb,8,6,1,1,0.0,0.0,GridBagConstraints.WEST,GridBagConstraints.NONE,new Insets(5,10,15,10));    	AMFWFrame.getContentPane().add(tpJcb);    	    	createGroupButton = new JButton("Crer");    	createGroupButton.setAction(ActionsList.getAction("AddGroup"));    	addComponent(AMFWLayout,layoutConstraints,createGroupButton,1,10,6,1,0.0,0.0,GridBagConstraints.CENTER,GridBagConstraints.HORIZONTAL,new Insets(5,10,15,10));    	AMFWFrame.getContentPane().add(createGroupButton);    	    	JButton ok = new JButton("OK");    	ok.addActionListener(new ActionOk());		addComponent(AMFWLayout,layoutConstraints,ok,7,11,1,1,0.0,0.0,GridBagConstraints.EAST,GridBagConstraints.NONE,new Insets(20,10,10,10));		AMFWFrame.getContentPane().add(ok);		JButton annuler = new JButton("Annuler");		annuler.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent arg0) {                AMFWFrame.dispose();            }		});		addComponent(AMFWLayout,layoutConstraints,annuler,8,11,1,1,0.0,0.0,GridBagConstraints.EAST,GridBagConstraints.NONE,new Insets(20,10,10,10));		AMFWFrame.getContentPane().add(annuler);    }