I am new to JFrame
. I just started learning about creating a Java project. I created an input field as a date and inserted a DateChooseCombo
. I have 2 problems.
- When I run the application dates in the calendar are invisible but, it shows the date which is selected in the box.
- When I submit the form it gives an error as
"Cannot format given Object as a Date"
The code for the date is as follows:
SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
String addDate = dateFormat.format(txt_AddDate.getSelectedDate());
ps.setString(3 ,addDate);
The date format used is 04/30/2021
.
Can anyone help me to solve these two problems?