/** Update date spinner to synchronize with the other spinners */ private void updateDate() { // Get current month and year in int int month = ((SpinnerListModel) jspMonth.getModel()).getList().indexOf(jspMonth.getValue()); int year = ((Integer) spinnerYear.getValue()).intValue(); // Set a new maximum number of days for the new month and year SpinnerNumberModel numberModel = (SpinnerNumberModel) jspDay.getModel(); numberModel.setMaximum(new Integer(maxDaysInMonth(year, month))); // Set a new current day if it exceeds the maximum if (((Integer) (numberModel.getValue())).intValue() > maxDaysInMonth(year, month)) numberModel.setValue(new Integer(maxDaysInMonth(year, month))); // Get the current day int day = ((Integer) jspDay.getValue()).intValue(); // Set a new date in the date spinner jspDate.setValue(new GregorianCalendar(year, month, day).getTime()); }
public void refreshInterface() { assignValueToParameters(); rounded.setSelected(roundedCorners); thickModel.setValue(new Integer(thickness)); }