所以我试图在我的JLabel上添加一个新行来显示所有的汽车贷款摊销时间表,由于某种原因,“\ n”不起作用。 这是代码:
for (int i = 1; i <= newYears; i++) {
interest = newRate2 * amount;
principal = monthlyPayment - interest;
amount = amount - principal;
//console
System.out.println(i + "\t\t" + df.format(principal) + "\t\t" + df.format(interest) + "\t\t" + df.format(amount));
//Second Frame where i want to show the full amortization schedule
second.jlsPayment2.setText("" + i + " " + df.format(principal) + " " + df.format(interest) + " \n" + df.format(amount));
}
非常感谢任何帮助,谢谢