Bonjour,

j'ai importé dans un JTable le contenu d'une base de donnée. Suite à ça j'ai voulu changer le nom des entête en fonction de la date saisie.

Ce qui donne :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
table.getColumn("LUNDI").setHeaderValue("LUNDI" + sdf.format(calendar.getTime()));
Le problème se pose si je veux rechanger le nom du même entête en gros si je fais deux fois ça :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
table.getColumn("LUNDI").setHeaderValue("LUNDI" + sdf.format(calendar.getTime()))
table.getColumn("LUNDI").setHeaderValue("LUNDI" + sdf.format(calendar.getTime()));
Ça plante J'ai pensé que comme je changeais le nom du header c'était peut être normal du coup j'ai fait ça :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
table.getColumn(table.getColumnName(2)).setHeaderValue("MARDI " + sdf.format(calendar.getTime()));
pensant que ça résoudrait le problème mais... non...

Si quelqu'un a une idée je suis preneur

Ci-dessous le message d'erreur que j'obtiens si ça parle à quelqu'un :
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
<<Exception in thread "AWT-EventQueue-0" 2014/01/13
java.lang.IllegalArgumentException: Identifier not found
	at javax.swing.table.DefaultTableColumnModel.getColumnIndex(Unknown Source)
	at javax.swing.JTable.getColumn(Unknown Source)
	at menus.PlanificationMenu$1.propertyChange(PlanificationMenu.java:492)
	at java.beans.PropertyChangeSupport.fire(Unknown Source)
	at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
	at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
	at java.awt.Component.firePropertyChange(Unknown Source)
	at com.toedter.calendar.JTextFieldDateEditor.setDate(Unknown Source)
	at com.toedter.calendar.JTextFieldDateEditor.setDate(Unknown Source)
	at com.toedter.calendar.JDateChooser.setDate(Unknown Source)
	at com.toedter.calendar.JDateChooser.propertyChange(Unknown Source)
	at java.beans.PropertyChangeSupport.fire(Unknown Source)
	at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
	at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
	at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
	at java.awt.Component.firePropertyChange(Unknown Source)
	at javax.swing.JComponent.firePropertyChange(Unknown Source)
	at com.toedter.calendar.JDayChooser.setDay(Unknown Source)
	at com.toedter.calendar.JDayChooser.actionPerformed(Unknown Source)
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$200(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)>>

Merci