我试图将JOptionpane.showInputDialog的默认值设为2周后的日期。到目前为止我所看到的一切都是使用System.out.println在命令提示符下打印,我得到它。但是我该怎么做才能在InputDialog中正确显示。现在它似乎是假的。
Calendar now = Calendar.getInstance();
now.add(Calendar.WEEK_OF_YEAR,2);
fullname = (String)JOptionPane.showInputDialog(this, "Please type the name of the client");
phone = (String)JOptionPane.showInputDialog(this, "Please type the phone of the client");
date = (String)JOptionPane.showInputDialog(this, "Please type the date of the Order",Calendar.getInstance().getTime());
ddate = (String)JOptionPane.showInputDialog(this, "Please type the date of delivery",now);