code: @Override protected void resize() {
          width  = clock.getWidth() - clock.getInsets().getLeft() - clock.getInsets().getRight();
          height = clock.getHeight() - clock.getInsets().getTop() - clock.getInsets().getBottom();
  
          if (aspectRatio * width > height) {
              width = 1 / (aspectRatio / height);
          } else if (1 / (aspectRatio / height) > width) {
              height = aspectRatio * width;
          }
  
          if (width > 0 && height > 0) {
              pane.setMaxSize(width, height);
              pane.relocate((clock.getWidth() - height) * 0.5, (clock.getHeight() - height) * 0.5);
  
              if (clock.isTextVisible()) {
                  if (null == customFont) {
                      timeText.setFont(Locale.US == clock.getLocale() ? Fonts.robotoLight(0.5 * height) : Fonts.robotoLight(0.6 * height));
                  } else {
                      timeText.setFont(Locale.US == clock.getLocale() ? new Font(customFont.getName(), 0.5 * height) : new Font(customFont.getName(), 0.6 * height));
                  }
                  timeText.setX((width - timeText.getLayoutBounds().getWidth()) * 0.5);
                  if (clock.isDateVisible()) {
                      timeText.setY(height * 0.3);
                  } else {
                      timeText.setY(height * 0.5);
                  }
              }
              if (clock.isDateVisible()) {
                  if (null == customFont) {
                      dateText.setFont(Fonts.robotoLight(0.3 * height));
                  } else {
                      dateText.setFont(new Font(customFont.getName(), 0.3 * height));
                  }
                  dateText.setX((width - dateText.getLayoutBounds().getWidth()) * 0.5);
                  dateText.setY(height * 0.8);
              }
          }
      }
docs: ******************** Resizing ******************************************