简体   繁体   English

jDateChooser 的值恢复到默认值

[英]The value of jDateChooser is back to the default value

I'm using jDateChooser in NetBeans, when i run the program and choose any date, it is not choosing correctly.我在 NetBeans 中使用 jDateChooser,当我运行程序并选择任何日期时,它没有正确选择。 For example, if i choose 05-05-2020, it shows 29-12-2018.例如,如果我选择 05-05-2020,它会显示 29-12-2018。

Also, if it catch the selected date, when i press on another item (any button or text field), the Date back to its default.此外,如果它捕捉到选定的日期,当我按下另一个项目(任何按钮或文本字段)时,日期将恢复为默认值。

I didn't add any code related to it, only take it from tools box and put it on the Frame.我没有添加任何与之相关的代码,只是从工具箱中取出并放在框架上。

What is the problem?问题是什么?

The problem was that i am using wrong date format, it was YYYY-MM-dd, the correct one is yyyy- MM-dd问题是我使用了错误的日期格式,它是 YYYY-MM-dd,正确的是 yyyy-MM-dd

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM