求java日期加减运算代码几处注释2 代码已有且正确

来源:百度知道 编辑:UC知道 时间:2024/06/03 19:47:24
sysDate = date;
label0.setText("System Date is " + sdf.format(date));
this.dialogType = dialogType;
if (dialogType == 1) {
label1.setText("(Please inpupt a [yyyy-MM-dd] string)");
} else {
label1.setText("(Please input a Number)");
}

btn1.addActionListener(this);
btn2.addActionListener(this);

int x = (int)((Toolkit.getDefaultToolkit().getScreenSize().getWidth() - this.getWidth())/2);
int y = (int)((Toolkit.getDefaultToolkit().getScreenSize().getHeight() - this.getHeight())/2);
this.setLocation(x, y);

this.setModal(true);
this.setVisible(true);
}
public void actionPerformed(ActionEvent event) {
Object source = event.getSource();
if (source == btn1) {
if (dialogTyp

add(int field, int amount)
根据日历的规则,为给定的日历字段添加或减去指定的时间量。
c2.add(Calendar.DATE, -1);-1的意思是减去一天的意思如果是+1的话,就是加一天的意思