I'm trying to pull in a date so I can work with it in SQL. I put the jDateChooser on the screen and use it to define a string. Because it starts out with no value (null), it throws Null Pointer Exception. I initialize the JDateChooser with compdate.setCalendar(Calendar.getInstance());
This sets the date to today and that is the value I get returned when I pull in the string. The code is below and I would love to resolve this. I'm guessing it is from my ignorance about when the update should be firing...
JDateChooser compdate = new JDateChooser();
compdate.setDateFormatString("yyyy/MM/dd");
compdate.setBounds(26, 75, 144, 23);
compdate.setCalendar(Calendar.getInstance());
String jcalval = (new java.text.SimpleDateFormat("yyyy/MM/dd")).format(compdate.getDate());
panelReporting.add(compdate);
System.out.println(jcalval);