code: @Override
      public int getBaseline(int width, int height) {
          if (dateTextField.isVisible()) {
              return dateTextField.getBaseline(width, height);
          }
          return super.getBaseline(width, height);
      }
docs: getBaseline, This returns the baseline value of the dateTextField.