for (int i = 0; i < 7; i++) {
calendarTablePane.getColumns().add(new TablePane.Column(1, true));
}
// Month spinner
monthSpinner = new Spinner();
monthSpinner.setSpinnerData(new NumericSpinnerData(0, 11));
monthSpinner.setItemRenderer(new MonthSpinnerItemRenderer());
monthSpinner.setCircular(true);
monthSpinner.getStyles().put("sizeToContent", true);
monthSpinner.getSpinnerSelectionListeners().add(new SpinnerSelectionListener() {
@Override
public void selectedIndexChanged(Spinner spinner, int previousSelectedIndex) {
Calendar calendar = (Calendar)getComponent();
calendar.setMonth((Integer)spinner.getSelectedItem());
}
});
// Year spinner
yearSpinner = new Spinner();
yearSpinner.setSpinnerData(new NumericSpinnerData(0, Short.MAX_VALUE));
yearSpinner.getSpinnerSelectionListeners().add(new SpinnerSelectionListener() {
@Override
public void selectedIndexChanged(Spinner spinner, int previousSelectedIndex) {