@Override
    protected void buildContent() {

        boolean showWeeks = this.getControl().showWeeksProperty().get();
        int extra = (showWeeks ? 1 : 0);

        // table header with seven weekday names
        for (int colIndex = 0; colIndex < 7 + extra; colIndex++) {
            Label label = new Label();
            label.setMaxWidth(Double.MAX_VALUE);
            label.setAlignment(Pos.CENTER);
            if (showWeeks && colIndex == 0) {
                label.getStyleClass().add(CSS_CALENDAR_WEEK_OF_YEAR);
                add(label, 0, 0);
            } else {
                label.getStyleClass().add(CSS_CALENDAR_WEEKDAY_HEADER);
                add(label, colIndex, 0);
            }
        }

        // we use fixed count of rows (always 6) in order to avoid sudden changes in height when browsing
        for (int rowIndex = 0; rowIndex < 6; rowIndex++) {
            if (showWeeks) {
                Label label = new Label();
                label.setMaxWidth(USE_PREF_SIZE);
                label.setMaxHeight(Double.MAX_VALUE);
                GridPane.setVgrow(label, Priority.ALWAYS);
                GridPane.setHgrow(label, Priority.NEVER);
                GridPane.setHalignment(label, HPos.RIGHT);
                label.getStyleClass().add(CSS_CALENDAR_WEEK_OF_YEAR);
                add(label, 0, rowIndex + 1);
            }
            for (int colIndex = 0; colIndex < 7; colIndex++) {
                Button button = new Button();
                button.setMaxWidth(Double.MAX_VALUE);
                button.setMaxHeight(Double.MAX_VALUE);

                GridPane.setVgrow(button, Priority.ALWAYS);
                GridPane.setHgrow(button, Priority.ALWAYS);

                button.setOnAction(
                    actionEvent -> {
                        T selected = getControl().chronology().getChronoType().cast(button.getUserData());
                        T oldValue = getControl().selectedDateProperty().get();
                        if ((oldValue == null) || !oldValue.equals(selected)) {
                            getControl().selectedDateProperty().setValue(selected);
                        }
                    }
                );

                add(button, colIndex + extra, rowIndex + 1);
            }
        }

    }
@ Override protected void buildContent ( ) { boolean showWeeks = this . getControl ( ) . showWeeksProperty ( ) . get ( ) ; int extra = ( showWeeks ? 1 : 0 ) ; for ( int colIndex = 0 ; colIndex < 7 + extra ; colIndex ++ ) { Label label = new Label ( ) ; label . setMaxWidth ( Double . MAX_VALUE ) ; label . setAlignment ( Pos . CENTER ) ; if ( showWeeks && colIndex == 0 ) { label . getStyleClass ( ) . add ( CSS_CALENDAR_WEEK_OF_YEAR ) ; add ( label , 0 , 0 ) ; } else { label . getStyleClass ( ) . add ( CSS_CALENDAR_WEEKDAY_HEADER ) ; add ( label , colIndex , 0 ) ; } } for ( int rowIndex = 0 ; rowIndex < 6 ; rowIndex ++ ) { if ( showWeeks ) { Label label = new Label ( ) ; label . setMaxWidth ( USE_PREF_SIZE ) ; label . setMaxHeight ( Double . MAX_VALUE ) ; GridPane . setVgrow ( label , Priority . ALWAYS ) ; GridPane . setHgrow ( label , Priority . NEVER ) ; GridPane . setHalignment ( label , HPos . RIGHT ) ; label . getStyleClass ( ) . add ( CSS_CALENDAR_WEEK_OF_YEAR ) ; add ( label , 0 , rowIndex + 1 ) ; } for ( int colIndex = 0 ; colIndex < 7 ; colIndex ++ ) { Button button = new Button ( ) ; button . setMaxWidth ( Double . MAX_VALUE ) ; button . setMaxHeight ( Double . MAX_VALUE ) ; GridPane . setVgrow ( button , Priority . ALWAYS ) ; GridPane . setHgrow ( button , Priority . ALWAYS ) ; button . setOnAction ( actionEvent -> { T selected = getControl ( ) . chronology ( ) . getChronoType ( ) . cast ( button . getUserData ( ) ) ; T oldValue = getControl ( ) . selectedDateProperty ( ) . get ( ) ; if ( ( oldValue == null ) || ! oldValue . equals ( selected ) ) { getControl ( ) . selectedDateProperty ( ) . setValue ( selected ) ; } } ) ; add ( button , colIndex + extra , rowIndex + 1 ) ; } } }
~ Methoden ----------------------------------------------------------