JCalendar问题(2月份) [英] JCalendar problem (the month February)

查看:164
本文介绍了JCalendar问题(2月份)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个图形组件 JCalendar 用于选择日期。当地日期是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.

你怎么看?

推荐答案

假设 JCalendar 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.

附录:该错误也已修复 JCalendar ,版本1.4。

Addendum: The bug is also fixed in JCalendar, version 1.4.

这篇关于JCalendar问题(2月份)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆