Salut,

J'ai un petit probleme consernant mon JTABLE, c'est qu'il ne veux pas afficher les titres que je lui donne.

voici mon code source:

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
import java.awt.Color;
 
import javax.swing.JFrame;
import javax.swing.JTable;
 
public class MenuGauche extends JFrame{
 
	/**
         * 
         */
	private static final long serialVersionUID = 1L;
	public MenuGauche(){
		Object[][] donnees = {
			       {"Swing",    "Astral",     "standard",Color.red,    Boolean.TRUE},
			       {"Swing",    "Mistral",    "standard",Color.yellow, Boolean.FALSE},
			       {"Gin",      "Oasis",      "standard",Color.blue,   Boolean.FALSE},
			       {"Gin",      "boomerang",  "compétition",Color.green,  Boolean.TRUE},
			       {"Advance",  "Omega",      "performance",Color.cyan,   Boolean.TRUE},
				} ;
 
			 Object [] titreColonnes = { "modèle", "marque", "homologation","couleur", "vérifié ?"};
			 JTable jTable1 = new JTable(donnees,titreColonnes);
			 add(jTable1);
			 setVisible(true);
 
	}
	public static void main(String[] args) {
		new MenuGauche();
	}
}