为什么 jDateChooser 的值会回到默认值?

huangapple go评论63阅读模式
英文:

Why is the value of jDateChooser back to the default value?

问题

我在NetBeans中使用jDateChooser,在运行程序并选择任何日期时,它没有正确地选择日期。

例如,如果我选择了2020年5月5日,它会显示2018年12月29日。

此外,如果它捕获了所选日期,当我点击另一个项目(任何按钮或文本字段)时,日期会返回到默认值。

我没有添加任何与此相关的代码;我只是从工具箱中拖出它并放在了窗体上。

问题是什么?

英文:

I'm using jDateChooser in NetBeans, and when I run the program and choose any date, it is not choosing correctly.
For example, if I choose 05-05-2020, it shows 29-12-2018.

Also, if it catches the selected date, when I press on another item (any button or text field), the date returns to its default.

I didn't add any code related to it; I only took it from the tools box and put it on the frame.

What is the problem?

答案1

得分: 0

问题在于我使用了错误的日期格式,原本是YYYY-MM-dd,正确的格式是yyyy-MM-dd。

英文:

The problem was that i am using wrong date format, it was YYYY-MM-dd, the correct one is yyyy- MM-dd

huangapple
  • 本文由 发表于 2020年5月5日 20:18:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/61612972.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定