Path: csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: =?UTF-8?B?R3VscMKu?= Newsgroups: it.comp.java Subject: sommare valori da JTextField Date: Tue, 29 Sep 2015 09:48:45 +0200 Organization: Aioe.org NNTP Server Lines: 25 Message-ID: NNTP-Posting-Host: B29lDxYziyeAWnt1ZYlrLg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 X-Notice: Filtered by postfilter v. 0.8.2 X-Mozilla-News-Host: news://news.readfreenews.net:119 Xref: csiph.com it.comp.java:8559 C'č qualcosa di sbagliato in questo codice? private void Somma(){ double sum =0; double imp=0; String num; for (int i=0;i<13;i++){ num=txtImportoriga[i].getText(); if (num.length()>0){ //imp=Double.valueOf(num); imp=parseDouble(num); } else{ imp=0; } sum=sum + imp; txtTotale.setText(Uty.StrFormattaCur(sum,false)); } } Alcuni txtImportoriga hanno stringa: "" -- Gulp® (forse mi sono perso qualcosa :))