java 如何将当前日期从 pc 设置为 jDateChooser?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29834087/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 15:59:49 来源:igfitidea点击:
How to set current date to jDateChooser from pc?
提问by Erfan Ahmed
I have a situation that I need to fill the jDateChooser
box by the current date automatically (without clicking the pop up calender).
我有一种情况,我需要jDateChooser
在当前日期之前自动填充该框(无需单击弹出的日历)。
How can I do that?
我怎样才能做到这一点?
Thanks in advance.
提前致谢。
采纳答案by hakim el massari
Date date = new Date();
dateChooser.setDate(date);