问题描述
我有一个图形组件用于选择日期。当地日期是6月30日时,问题(或错误)仍然存在;例如,当我经历二月份时,我会用箭头浏览月份,日期会自动插入(2月28日),因为事件propertyChange会启动,除非我选择。
I have a graphical component JCalendar
for choosing the date. A problem (or bug) persists when my local date is June 30; for example, I go through the months with the arrow when I go through the month of February, the date is inserted automatically (February 28) because the event "propertyChange" is starts unless I select.
你怎么看?
推荐答案
假设和 JSpinnerDateEditor
,我发现6月30日或2月28日附近没有 JCalendarDemo 。您可以验证您是否正在观察正确的属性更改:
Assuming JCalendar and JSpinnerDateEditor
, I see no discontinuities near June 30 or February 28 in JCalendarDemo
. You might verify that you are observing the correct property change:
JDateChooser spinner = new JDateChooser(new JSpinnerDateEditor());
spinner.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent e) {
System.out.println(e.getPropertyName()
+ ": " + e.getNewValue());
}
});
this.add(spinner);
附录:我无法重现你描述的效果,因为它是一个已修复的错误。
Addendum: I am unable to reproduce the effect you describe because it's a bug that's fixed here.
附录:该错误也已修复,版本1.4。
Addendum: The bug is also fixed in JCalendar
, version 1.4.
这篇关于JCalendar问题(2月份)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!