Les layout ça me casse la figure!!!
en utilisant un jpanel je setlayout(null) dans jpanel,
puis je positionne les composants par .setBounds()
mais cette fois ça pas marché!!!
Et rien n'est affiché!!
Voici le code

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
 
 
		P=new JPanel();
		P.setSize(500,650);
		P.setLayout(null);
		P.setBackground(Color.WHITE);
		JLabel im = new JLabel(new ImageIcon("logos/MBRD Logo2.JPG"));
		im.setBounds(-50,9,180,100);
		P.add(im); 
 
 
		JLabel fA = new JLabel ("SOCIETE EL MOUBARRED");
		fA.setForeground(Color.BLACK  );
		 fontA =new Font("CHB",Font.ITALIC,16) ;
		fA.setFont(fontA);
		fA.setBounds(130,10,350,30);
		P.add(fA);
 
 
		JLabel DT = new JLabel ("   Direction Technique");
		DT.setForeground(Color.BLACK  );
		 Font fontDT = new Font("CHB",Font.ITALIC,14);
		DT.setFont(fontDT);
		DT.setBounds(160,30,350,30);
		P.add(DT);
 
 
 
		JLabel DT2 = new JLabel ("BMED ");
		DT2.setForeground(Color.BLACK  );
 
		DT2.setFont(fontDT);
		DT2.setBounds(210,45,350,30);
		P.add(DT2);
 
		JLabel FA = new JLabel ("FICHE ARTICLE");
		FA.setForeground(Color.BLACK  );
		 Font fontFA = new Font("CHB",Font.ITALIC,24);
		 FA.setFont(fontFA);
		 FA.setBounds(145,65,350,30);
			P.add(FA);
 
 
 
 
SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
 
		String date0 = format.format(new Date());
		JLabel text_date = new JLabel();
		text_date.setFont(fontA);
		text_date.setBounds(183,90,300,30);
		text_date.setText(date0);
		P.add(text_date);
 
 
 
		this.add(P);