Prob JTable
Résolu
Bonjour,
j'ai un prob o niveau de JTable je creé un Jtable et lors de la compilation il m'affich tableau sans les titre des columne est ce vous pourrait me dire c'est quoi prob merci voici un extrait du code
Object[][] data = {
{"Mary", "Campione",
"Snowboarding", new Integer(5), new Boolean(false)},
{"Alison", "Huml",
"Rowing", new Integer(3), new Boolean(true)},
{"Kathy", "Walrath",
"Knitting", new Integer(2), new Boolean(false)},
{"Sharon", "Zakhour",
"Speed reading", new Integer(20), new Boolean(true)},
{"Philip", "Milne",
"Pool", new Integer(10), new Boolean(false)}
};
String[] columnNames = {"First Name",
"Last Name",
"Sport",
"# of Years",
"Vegetarian"};
JTable tata = new JTable(data,columnNames);
tata.setVisible(true);
JPanel pantab= new JPanel();
pantab.add(tata);
pantab.setLayout(new GridLayout(1,0));
est apres j'ajoute pantab ds une Panel qui affiche
merci est dsl pr derangement
j'ai un prob o niveau de JTable je creé un Jtable et lors de la compilation il m'affich tableau sans les titre des columne est ce vous pourrait me dire c'est quoi prob merci voici un extrait du code
Object[][] data = {
{"Mary", "Campione",
"Snowboarding", new Integer(5), new Boolean(false)},
{"Alison", "Huml",
"Rowing", new Integer(3), new Boolean(true)},
{"Kathy", "Walrath",
"Knitting", new Integer(2), new Boolean(false)},
{"Sharon", "Zakhour",
"Speed reading", new Integer(20), new Boolean(true)},
{"Philip", "Milne",
"Pool", new Integer(10), new Boolean(false)}
};
String[] columnNames = {"First Name",
"Last Name",
"Sport",
"# of Years",
"Vegetarian"};
JTable tata = new JTable(data,columnNames);
tata.setVisible(true);
JPanel pantab= new JPanel();
pantab.add(tata);
pantab.setLayout(new GridLayout(1,0));
est apres j'ajoute pantab ds une Panel qui affiche
merci est dsl pr derangement
Configuration: Windows XP Internet Explorer 6.0