# DateTextFieldHandle

Import: `import com.install4j.api.test.formcomponents.DateTextFieldHandle;`

```java
interface DateTextFieldHandle extends FormComponentHandle
```

Handle for the "Text field with date format" form component. The Swing widget is a
`JTextField`. The handle exposes both the raw text and a `Date`-typed accessor.

Reach this handle via [`ScreenHandle.dateTextField`](../ui/ScreenHandle.md#datetextfield).

## Inherited from

- [FormComponentHandle](FormComponentHandle.md) — 7 methods

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`getText()`](#gettext) | `String` | The current text in the field. |
| [`getDate()`](#getdate) | `Date` | The current value as a `Date`, or `null` if the field is empty or unparseable. |
| [`setText(String)`](#settext-string) | `DateTextFieldHandle` | Set the field's raw text. |
| [`setDate(Date)`](#setdate-date) | `DateTextFieldHandle` | Set the field's value via the form component's formatter. |
| [`clear()`](#clear) | `DateTextFieldHandle` | Clear the field. |
| [`assertText(String)`](#asserttext-string) | `DateTextFieldHandle` | Assert the current text equals the expected value. |
| [`assertEnabled()`](#assertenabled) | `DateTextFieldHandle` |  |
| [`assertDisabled()`](#assertdisabled) | `DateTextFieldHandle` |  |
| [`assertVisible()`](#assertvisible) | `DateTextFieldHandle` |  |
| [`assertInvisible()`](#assertinvisible) | `DateTextFieldHandle` |  |

### getText()

```java
String getText()
```

The current text in the field.

### getDate()

```java
@Nullable Date getDate()
```

The current value as a `Date`, or `null` if the field is empty or unparseable.

### setText(String)

```java
DateTextFieldHandle setText(String text)
```

Set the field's raw text.

### setDate(Date)

```java
DateTextFieldHandle setDate(Date date)
```

Set the field's value via the form component's formatter.

### clear()

```java
DateTextFieldHandle clear()
```

Clear the field.

### assertText(String)

```java
DateTextFieldHandle assertText(String expected)
```

Assert the current text equals the expected value.

### assertEnabled()

```java
DateTextFieldHandle assertEnabled()
```

### assertDisabled()

```java
DateTextFieldHandle assertDisabled()
```

### assertVisible()

```java
DateTextFieldHandle assertVisible()
```

### assertInvisible()

```java
DateTextFieldHandle assertInvisible()
```

