if (tabSurface.getJXTabProjet().getValueAt(0, annee)==null)
this.totale = Float.parseFloat((String) tabSurface.getJXTabProjet().getValueAt(0, annee));
else
this.totale = 0;
Quelqu'un peut-il m'écrire ceci en une ligne ?
:P
Version imprimable
if (tabSurface.getJXTabProjet().getValueAt(0, annee)==null)
this.totale = Float.parseFloat((String) tabSurface.getJXTabProjet().getValueAt(0, annee));
else
this.totale = 0;
Quelqu'un peut-il m'écrire ceci en une ligne ?
:P
Hein pardon? 8O
Pour quoi faire :? ?
oui :Citation:
Envoyé par fabred
;)Code:this.totale = maFonction(mesParametres);
Totalle est un float et quand le champs du tableau JXTable n'est pas remplit,
il est impossible de convertir la chaine en flottant
Du coup, exist'il un moyen plus simple pour transformer une chaîne en flottant meme si la chaine est null ?
De suite avec une petite phrase d'explication, c'est plus clair :)
Tu peux redéfinir ta méthode getValueAt() dans ton TableModel afin qu'il renvoie 0. si la valeur est nulle...
Merci :king: