Search code examples
javanetbeansjdatechooser

How to setDate of JDateChooser to NULL or "0000-00-00"


This is my code, but it is not working.

if (Start.getDate() == null && End.getDate() == null) {
     Start.setDate(null);
     End.setDate(null);
}

So, how can i set the date of JDateChooser to null or "0000-00-00" ?

In my program the user can click on the Table to view the information of each row. and each row is connected to the database so the Start(JDateChooser) & End(JDateChooser) has a value on the database. the problem is when the user clicked on the row which has a value for Start & End the value successfully showed on JDateChoosers based on the database BUT when the user click again on another row which is the row dont have a value for Start & End the JDatechoosers is not making a NULL or ""(Empty)? it stil have a value.


Solution

  • I don't think you can set your date to 0000-00-00. Cos the minSelectableDate of jDateChooser is Jan 1, 0001