0

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.

Xyryle Buen
  • 43
  • 2
  • 12
  • Please post your more code that how you made your JDateChooser.... – CoderNeji Apr 17 '15 at 04:25
  • Im Using JFrame form so that is Drag & drop – Xyryle Buen Apr 17 '15 at 04:49
  • why you want to set null to date? – Java Man Apr 17 '15 at 04:51
  • from netbeans if yes then what plugin you are using ??? – CoderNeji Apr 17 '15 at 04:51
  • Im using JCalendar.jar – Xyryle Buen Apr 17 '15 at 05:01
  • 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. – Xyryle Buen Apr 17 '15 at 05:01

1 Answers1

2

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

NewBee Developer
  • 432
  • 2
  • 9
  • 26