如何在JOptionpane.showInputDialog中的当前日期之后2周显示日期

时间:2016-05-29 13:43:56

标签: java calendar joptionpane

我试图将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);

0 个答案:

没有答案