Salut,
J'ai une coquille avec le code suivant :
Code :
- public Object getValueAt(int row, int column) {
- switch (column) {
- case 0:
- return factures[row].getNumero();
- case 1:
-
- if (factures[row].getClient() == null){
- return "null";
- } else {
- return factures[row].getClient().getId(); // Id du client
- }
- case 2:
- java.text.DateFormat dateFormat = new java.text.SimpleDateFormat("dd-MM-yy" );
- return dateFormat.format(factures[row].getDate());
- }
- return null;
- }
|
C'est donc dans une classe qui extends AbstractTableModel ... enfin bref y a de la JTable derriere quoi.
Et je me prend une jolie exception in the face :
Code :
- Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
- at java.util.Calendar.setTime(Calendar.java:1032)
- at java.text.SimpleDateFormat.format(SimpleDateFormat.java:785)
- at java.text.SimpleDateFormat.format(SimpleDateFormat.java:778)
- at java.text.DateFormat.format(DateFormat.java:314)
- at fr.unice.toto.gui.RowSetFacture.getValueAt(RowSetFacture.java:79)
|
Que faire ?
EDIT : Arrêter la geudro !
Message édité par Chronoklazm le 03-12-2005 à 11:35:02
---------------
Scheme is a programmable programming language ! I heard it through the grapevine !