code: public void setTime(LocalTime optionalTime) {
          // Set the text field to the supplied time, using the standard format for null, or a time.
          String standardTimeString = zGetStandardTextFieldTimeString(optionalTime);
          String textFieldString = timeTextField.getText();
          // We will only change the time, when the text of the last valid time does not match the
          // supplied time. This will prevent any registered time change listeners from receiving
          // any events unless the time actually changes.
          if ((!standardTimeString.equals(textFieldString))) {
              zInternalSetTimeTextField(standardTimeString);
          }
      }
docs: setTime, This sets this time picker to the specified time. Times that are set from this
  function are processed through the same validation procedures as times that are entered by
  the user.
  
  More specifically:
  
  The "veto policy" and "allowEmptyTimes" settings are used to determine whether or not a
  particular value is "allowed".
  
  Allowed values will be set in the text field, and also committed to the "last valid value".
  Disallowed values will be set in the text field (with a disallowed indicator font), but will
  not be committed to the "last valid value".
  
  A value can be checked against any current veto policy, and against the allowEmptyTimes
  setting, by calling isTimeAllowed(). This can be used to determine (in advance), if a
  particular value would be allowed.
  
  Note: If empty times are allowed, and the component does not have a veto policy, then all
  possible values will (always) be allowed. These are the default settings of this component.
  
  Implementation Note: Whenever the text field changes to a valid time string, the
  lastValidTime is also automatically set (unless the time is vetoed). This occurs through the
  DocumentListener which is registered on the timeTextField.