Salut Tout le monde
j'ai un problem avec gridbaglayout j'ai cré un JPanel avec GridBagLayout et je veut faire comme cela

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
*************
*              *   *
*      A      * B *
*              *   *
*************      
*       C          *
*************
sachant que cette forme reste la même i on redimensionne la fenêtre voici on code mais sa marche pas vraiment super car par fois l'affichage est parfait parfois c'est catastrophique et voici mon 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
 
public JPanel Construire(String name){
		oldvalue = 0;
		JTextPane DialogSalon = new JTextPane();
		DialogSalon.setName(name);
		TxtMap.put(name, DialogSalon);
		setLayout(new GridBagLayout());
		GridBagConstraints c = new GridBagConstraints();
                //ici composant A qui est un jtextpane
		c.anchor = GridBagConstraints.FIRST_LINE_START ;
		c.gridx = 0 ;
		c.gridy = 0;;
		c.weightx = 10 ;
		c.weighty = 100 ;
		c.fill = GridBagConstraints.BOTH;
		scrolpane = new JScrollPane();
		DialogSalon.setAutoscrolls(true);
		scrolpane.getViewport().add(DialogSalon);
		scrolpane.getVerticalScrollBar().addAdjustmentListener(this);
                scrolpane.getVerticalScrollBar().addMouseListener(this);
	      scrolpane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
		add(scrolpane,c);
		//List Pseudo composant B
		c.gridwidth = GridBagConstraints.REMAINDER ;
		c.weightx = 1 ;
		c.weighty = .0 ;
		c.gridx = 1;
		c.gridy = 0;
		c.gridheight = 2;
		add(PanelListPseudo(name),c);
                //composant C
		c.weightx = .0 ;
		c.weighty = .0 ;
		c.gridx = 0 ;
		c.gridy = 2;
		c.gridwidth = GridBagConstraints.REMAINDER ;
		c.gridheight = GridBagConstraints.REMAINDER ;
		c.fill = GridBagConstraints.BOTH;
		c.anchor = GridBagConstraints.LAST_LINE_START;
		add(PanelBarre(),c);
		RightPanel.AddPanel(this,getName());
		return this ;
	}