Apparently, I'm missing something fundamental. I'm having a problem with formatting the value of a jspinner. I've tried a couple different ways and keep receiving an error, didn't keep track of them, other than it has to do with how I'm trying to grab the value from jspinner.
Here is the spinner code:
//setup date format for both spinners
SimpleDateFormat datePattern = new SimpleDateFormat("MM/dd/yyyy");
JSpinner dateFrom = new JSpinner(new SpinnerDateModel());
dateFrom.setEditor(new JSpinner.DateEditor(dateFrom, datePattern.toPattern()));
JPanel dateFromPanel = new JPanel(new GridLayout());
dateFromPanel.add(dateFrom);
dateFromPanel.setBorder(new TitledBorder("Date - From"));
Here is how I'm currently trying to get the format:
SimpleDateFormat sdfSource = new SimpleDateFormat("MM/dd/yyyy");
Date from = sdfSource.parse(dateFrom.getValue().toString());
SimpleDateFormat sdfDestination = new SimpleDateFormat("MM/dd/yyyy");
String dosFrom = sdfDestination.format(from);
Current error: Exception in thread "main" java.text.ParseException: Unparseable date: "Mon Oct 23 00:00:00 EDT 2006"