Salut à tous,

Je suis en train de faire un logiciel pour un projet et je bloque sur un point...
J'utilise les gridbaglayout pour faire mon projet... Jusque là aucun soucis mais je viens de tomber sur un os...

Voila ce qu'il se passe :
J'ai noté en vert sur quoi il fait les centrages . Vu que j'ai mis reminder il fait les centrages sur la totalité de la derniere case pour cette derniere case...
(on remarque aussi que le champ texte en haut est tout petit, mais ca c'est secondaire :p )

Voila ce que je veux obtenir :

Et voici ce satané 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
GridBagConstraints gbc = new GridBagConstraints();
		gbc.gridx = gbc.gridy = 0; // la grille commence en (0, 0)
		gbc.gridwidth = GridBagConstraints.REMAINDER; 
		gbc.gridheight = 1; 
		gbc.anchor = GridBagConstraints.BASELINE;
		gbc.insets = new Insets(10, 0, 30, 0);
		this.pere.getPanelPrincipal().add(new JLabel("RECHERCHER UNE FICHE"),gbc);
 
		gbc.gridy++;
		gbc.gridx = 0;
		gbc.gridwidth = 1; 
		gbc.gridheight = 1;
		gbc.insets = new Insets(0, 0, 0, 5);
		gbc.anchor = GridBagConstraints.CENTER;
		this.pere.getPanelPrincipal().add(new JLabel("Numero de fiche : "),gbc);
 
		gbc.gridx = 1;
		gbc.insets = new Insets(-2, 5, 0, 0);
		gbc.anchor = GridBagConstraints.CENTER;
		gbc.gridwidth = GridBagConstraints.REMAINDER; 
		this.pere.getPanelPrincipal().add(this.getRechercheFicheChampNum(),gbc);
 
 
		gbc.gridy++;
		gbc.gridx = 0;
		gbc.gridwidth = 1; 
		gbc.gridheight = 1;
		gbc.insets = new Insets(10, 0, 0, 5);
		gbc.anchor = GridBagConstraints.CENTER;
		this.pere.getPanelPrincipal().add(new JLabel("Date début : "),gbc);
 
		gbc.gridx = 1;
		gbc.insets = new Insets(10, 5, 0, 5);
		this.pere.getPanelPrincipal().add(this.getRechercheFicheComboJourDe(cDeb.get(Calendar.DAY_OF_MONTH)),gbc);
 
		gbc.gridx = 2;
		gbc.insets = new Insets(10, 5, 0, 5);
		this.pere.getPanelPrincipal().add(this.getRechercheFicheComboMoisDe(cDeb.get(Calendar.MONTH)),gbc);
 
		gbc.gridx = 3;
		gbc.insets = new Insets(10, 5, 0, 0);
		gbc.gridwidth = 1; 
		this.pere.getPanelPrincipal().add(this.getRechercheFicheComboAnneeDe(cDeb.get(Calendar.YEAR)),gbc);
 
		gbc.gridy++;
		gbc.gridx = 0;
		gbc.gridwidth = 1; 
		gbc.gridheight = 1;
		gbc.insets = new Insets(10, 0, 0, 5);
		gbc.anchor = GridBagConstraints.CENTER;
		this.pere.getPanelPrincipal().add(new JLabel("Date fin : "),gbc);
 
		gbc.gridx = 1;
		gbc.insets = new Insets(10, 5, 0, 5);
		this.pere.getPanelPrincipal().add(this.getRechercheFicheComboJourA(cAuj.get(Calendar.DAY_OF_MONTH)),gbc);
 
		gbc.gridx = 2;
		gbc.insets = new Insets(10, 5, 0, 5);
		this.pere.getPanelPrincipal().add(this.getRechercheFicheComboMoisA(cAuj.get(Calendar.MONTH)),gbc);
 
		gbc.gridx = 3;
		gbc.insets = new Insets(10, 5, 0, 0);
		gbc.anchor = GridBagConstraints.CENTER;
		this.pere.getPanelPrincipal().add(this.getRechercheFicheComboAnneeA(cAuj.get(Calendar.YEAR)),gbc);
 
		gbc.gridy++;
		gbc.gridx = 0;
		gbc.gridwidth = 1; 
		gbc.gridheight = 1;
		gbc.insets = new Insets(10, 0, 0, 5);
		gbc.anchor = GridBagConstraints.CENTER;
		this.pere.getPanelPrincipal().add(new JLabel("Type d'incident : "),gbc);
 
		gbc.gridx = 1;
		gbc.insets = new Insets(10, 5, 0, 0);
		gbc.gridwidth = GridBagConstraints.REMAINDER; 
		this.pere.getPanelPrincipal().add(this.getRechercheFicheComboTypeIncident(),gbc);
 
		gbc.gridy++;
		gbc.gridx = 0;
		gbc.gridwidth = 1; 
		gbc.gridheight = 1;
		gbc.insets = new Insets(10, 0, 0, 5);
		gbc.anchor = GridBagConstraints.BASELINE;
		this.pere.getPanelPrincipal().add(new JLabel("Incident : "),gbc);
 
		gbc.gridx = 1;
		gbc.insets = new Insets(10, 5, 0, 0);
		gbc.gridwidth = GridBagConstraints.REMAINDER; 
		this.pere.getPanelPrincipal().add(this.getRechercheFicheComboIncident(),gbc);
 
		gbc.gridy++;
		gbc.gridx = 0;
		gbc.gridwidth = 1; 
		gbc.gridheight = 1;
		gbc.insets = new Insets(10, 0, 0, 5);
		gbc.anchor = GridBagConstraints.CENTER;
		this.pere.getPanelPrincipal().add(new JLabel("Entreprise appelée : "),gbc);
 
		gbc.gridx = 1;
		gbc.insets = new Insets(10, 5, 0, 0);
		gbc.gridwidth = GridBagConstraints.REMAINDER; 
		this.pere.getPanelPrincipal().add(this.getRechercheFicheComboEntreprise(),gbc);
 
		gbc.gridx = 0;
		gbc.gridy++;
		gbc.gridwidth = GridBagConstraints.REMAINDER; 
		gbc.gridheight = 1;
		gbc.insets = new Insets(10, 0, 0, 0);
		this.pere.getPanelPrincipal().add(getRechercheFicheButtonValider(),gbc);
 
		gbc.gridy++;
		gbc.gridx = 0;
		gbc.gridwidth = 1; 
		gbc.gridheight = 1;
		gbc.insets = new Insets(15, 10, 0, 0);
		gbc.anchor = GridBagConstraints.LINE_START;
		this.pere.getPanelPrincipal().add(new JLabel("Résultats : "),gbc);
 
		gbc.gridx = 1;
		gbc.gridwidth = GridBagConstraints.REMAINDER;
		gbc.gridheight = 1;
		gbc.insets = new Insets(15, 10, 0, 30);
		gbc.anchor = GridBagConstraints.LINE_END;
		this.pere.getPanelPrincipal().add(this.getRechercheFicheLabelNbTrouve(),gbc);
 
		/*si cette partie est commentée ca fait le deuxième schéma*/
                gbc.gridx = 0;
		gbc.gridy++;
		gbc.gridheight = 1;
		gbc.weightx = 1.;
		gbc.weighty = 1.;
		gbc.fill = GridBagConstraints.BOTH;
		gbc.anchor = GridBagConstraints.FIRST_LINE_START;
		gbc.insets = new Insets(10, 30, 10, 30);
		this.pere.getPanelPrincipal().add(this.getRechercheFicheListeResultat(tabFiche),gbc);
 
		gbc.gridx = 0;
		gbc.gridy++;
		gbc.gridwidth = GridBagConstraints.REMAINDER;
		gbc.gridheight = 1;
		gbc.weightx = 0;
		gbc.weighty = 0;
		gbc.insets = new Insets(10, 0, 10, 0);
		gbc.fill = GridBagConstraints.NONE;
		gbc.anchor = GridBagConstraints.CENTER;
		this.pere.getPanelPrincipal().add(getRechercheFicheButtonAfficher(),gbc);
 
		this.pere.getPanelPrincipal().revalidate();
		this.pere.getPanelPrincipal().repaint();
Voilà vous savez mon problème, et si vous pouviez m'aider, ca m'arrangerait à mort =)

MERCI davance