code: public Date getDate() {
          Date date = new Date();
          try {
              String dateText = field.getText();
              SimpleDateFormat fmt = new SimpleDateFormat(format);
              date = fmt.parse(dateText);
          } catch (Exception e) {
          }
          return date;
      }
docs: Convert text of textfield to Date
  
  @return Date shown at textfield or new Date if failed to parse