问题描述
我有2个JDateChooser
,startDate
和endDate
。
-
我想将
startDate
的最小日期设置为当前日期, -
我从
startDate
中选择日期,它应该是endDate
的最小日期,并且应该选择它。如何动态设置最小日期?
datechStartD = new JDateChooser(new Date());
Calendar c=Calendar.getInstance();;
datechStartD.getCalendarButton().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
c.setTime(datechStartD.getDate() );
c.add(Calendar.DATE,5); // adding next start date
dateChooserEndD.getJCalendar().setMinSelectableDate(c.getTime());
}
});
datechStartD.setBounds(180,144,150,30);
datechStartD.getJCalendar().setMinSelectableDate(new Date());
dateChooserEndD = new JDateChooser();
dateChooserEndD.setBounds(180,198,30);
GUI of the Start date and endDate
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)