Tuesday, October 23, 2018

java - How to get date picker date in to text field?




Date Date1 = jXDatePicker1.getDate();
datestartField.setText(Date1);


Hint: String cannot be converted to date.


Answer



date can not assign to textfield as it is object .You can convert it in String using SimpledateFormat




    Date Date1 = jXDatePicker1.getDate();
DateFormat df = new SimpleDateFormat("dd MMM yyyy hh:mm a",
Locale.US);
datestartField.setText(df.format(date1));


Hope so it will help you..


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...