Validating two JSpinners

46 Views Asked by At

I have two JSpinners in one GUI:

JSpinner spinner1 = new JSpinner(model1); // To select start date
JSpinner spinner2 = new JSpinner(model); // to select end date

How can I ensure that the end date is greater than the start date?

for example:

Start Date: 07/12/2014
End Date: 10/12/2014

The above is valid. But what if the user selects:

Start Date: 10/12/2014
End Date: 07/12/2014

Which of course is invalid as you cannot end before you start. Is there a way to ensure that the end date will be greater than than the start date?

0

There are 0 best solutions below