24-03-2011, 22:58
|
|
|
חבר מתאריך: 02.12.09
הודעות: 19
|
|
בעיה די פשוטה JAVA
היי אני לומד JAVA ויש לי בעיה די פשוטה אני משתמש בsetText ומעוניין לירשום לחלונית הטקסט מספר פעמים אבל כל פעם שאני רושם כלומר משתמש בsetText הוא מוחק את הכל ורושם רק את השורה האחרונה
תודה
for (i_yr=5.0; i_yr<8.1; i_yr=i_yr+.125)
{
j_mo= i_yr/(12.0*100); // j= monthly interest I/(12*100)
mo= j_mo+1; // 1+j
N=loantime*12.0; /// term in months
ans= Math.pow(mo,-N);
monthlyPay= loanamount*(j_mo/(1-ans));
payment= monthlyPay*N;
display=("Interest Rate = " + i_yr+ " Monthly Payment = " +monthlyPay+ " Total Payment = "+payment +"\n");
System.out.println(display);
if (decimal== true)
{
DecimalFormat num =new DecimalFormat("###0.00");
display=("Interest Rate = " + i_yr+ " Monthly Payment = " +num.format(monthlyPay)+ " Total Payment = "+num.format(payment) +"\n");
text.setText(display);
נערך לאחרונה ע"י birendorf בתאריך 24-03-2011 בשעה 23:15.
|