int day = Integer.parseInt(inputDay.getText());
int month = Integer.parseInt(inputMonth.getText());
int year = Integer.parseInt(inputYear.getText());
int dayNow = Integer.parseInt(inputDayNow.getText());
int monthNow = Integer.parseInt(inputMonthNow.getText());
int yearNow = Integer.parseInt(inputYearNow.getText());
//total.setText(day + "/" + day + "=" + day/day);
System.out.println(((yearNow-year)*365)+((monthNow-month)*30)+(dayNow-day));
我想让 System.out.println 显示在文本区域
答案 0 :(得分:1)
使用JTextArea并实现setText()方法...试试这个
JTextArea t = new JTextArea();
t.setText(Integer.toString(((yearNow-year)*365)+((monthNow-month)*30)+(dayNow-day)));
答案 1 :(得分:1)
dateNow.setText(((yearNow-year)*365)+((monthNow-month)*30)+(dayNow-day))
使用此文件由Logger放置,使用Rolling File Appender,将其带到控制台以及Log的文件,可以使用IO轻松将其用于将来检索。