en exécutant le code qui suit j'obtiens un tableau avec des noms A,B,C
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
public class MyFrame extends JFrame{
 
	public static void main(String[] args) {
		MyFrame frame = new MyFrame();
	}
 
	public MyFrame(){
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		JScrollPane scrollPane = new JScrollPane(new JTable(new MyModel()));
		getContentPane().add(scrollPane);
		pack();
		show();
	}
 
	class MyModel extends AbstractTableModel{
		private Object[][] data = new Object[][]{{new Boolean(true), new Boolean(false),new Boolean(true)}};
		private String[] colNames = new String[]{"un","deux","trois"};
		private Class[] colClass = new Class[]{Boolean.class,Boolean.class,Boolean.class};
 
		public MyModel(){
			super();
		}
 
		public int getColumnCount() {
			return colNames.length;
		}
 
		public int getRowCount() {
			return data.length;
		}
 
		public Object getValueAt(int arg0, int arg1) {
			return data[arg0][arg1];
		}
 
		public boolean isCellEditable(int arg0, int arg1) {
			return true;
		}
 
		public Class getColumnClass(int arg0) {
			return colClass[arg0];
		}
 
	}//:-
 
}///:-

Je veux changer les noms de ces colonnes .Comment?