Reputation: 1375
I got a custom class that contains JodaTime's LocalDate variable to hold a date. My swing application has a JSpinner with Date model. I made a button click event so that the date gets stored inside an object's LocalDate data member. Problem is compiler gives me the IllegalArgumentException.
I tried to use LocalDate.parse(spinnerDate.getVAlue().toString()) but is not working. Also tried to switch to using DateTime type but same result was given.
Upvotes: 0
Views: 828
Reputation: 13056
Given that an IllegalArgumentException
is something that would be generated at runtime, I doubt you're getting a 'compiler' error.
If you don't care what the timezone or chronology is (probable), you could always use new LocalDate(spinnerDate.getValue());
.
Otherwise, consider implementing your own spinner that can store LocalDate
s natively, or switching to using a pre-defined list of LocalDate
s in a SpinnerListModel
.
Upvotes: 1