# MaskTextFieldHandle

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

```java
interface MaskTextFieldHandle extends FormComponentHandle
```

Handle for the "Text field with format mask" form component. The Swing widget is a
`JTextField` with an input mask such as `"###-##-####"`. The underlying mask
formatter rejects input that doesn't fit the mask.

Reach this handle via [`ScreenHandle.maskTextField`](../ui/ScreenHandle.md#masktextfield).

## Inherited from

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

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`getText()`](#gettext) | `String` | The current text in the field. |
| [`setText(String)`](#settext-string) | `MaskTextFieldHandle` | Set the field's text. |
| [`clear()`](#clear) | `MaskTextFieldHandle` | Clear the field. |
| [`assertText(String)`](#asserttext-string) | `MaskTextFieldHandle` | Assert the current text equals the expected value. |
| [`assertEnabled()`](#assertenabled) | `MaskTextFieldHandle` |  |
| [`assertDisabled()`](#assertdisabled) | `MaskTextFieldHandle` |  |
| [`assertVisible()`](#assertvisible) | `MaskTextFieldHandle` |  |
| [`assertInvisible()`](#assertinvisible) | `MaskTextFieldHandle` |  |

### getText()

```java
String getText()
```

The current text in the field.

### setText(String)

```java
MaskTextFieldHandle setText(String text)
```

Set the field's text. Input that doesn't fit the mask is rejected.

### clear()

```java
MaskTextFieldHandle clear()
```

Clear the field.

### assertText(String)

```java
MaskTextFieldHandle assertText(String expected)
```

Assert the current text equals the expected value.

### assertEnabled()

```java
MaskTextFieldHandle assertEnabled()
```

### assertDisabled()

```java
MaskTextFieldHandle assertDisabled()
```

### assertVisible()

```java
MaskTextFieldHandle assertVisible()
```

### assertInvisible()

```java
MaskTextFieldHandle assertInvisible()
```

