# IntegerTextFieldHandle

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

```java
interface IntegerTextFieldHandle extends FormComponentHandle
```

Handle for the "Text field with integer format" form component. The Swing widget is a
`JTextField` with an integer-only verifier.

Reach this handle via [`ScreenHandle.integerTextField`](../ui/ScreenHandle.md#integertextfield).

## Inherited from

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

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`getText()`](#gettext) | `String` | The current text in the field. |
| [`getValue()`](#getvalue) | `Integer` | The current value as an `Integer`, or `null` if the field is empty or invalid. |
| [`setText(String)`](#settext-string) | `IntegerTextFieldHandle` | Set the field's raw text. |
| [`setValue(int)`](#setvalue-int) | `IntegerTextFieldHandle` | Set the field's value as an integer. |
| [`clear()`](#clear) | `IntegerTextFieldHandle` | Clear the field. |
| [`assertText(String)`](#asserttext-string) | `IntegerTextFieldHandle` | Assert the current text equals the expected value. |
| [`assertValue(int)`](#assertvalue-int) | `IntegerTextFieldHandle` | Assert the current integer value equals the expected value. |
| [`assertEnabled()`](#assertenabled) | `IntegerTextFieldHandle` |  |
| [`assertDisabled()`](#assertdisabled) | `IntegerTextFieldHandle` |  |
| [`assertVisible()`](#assertvisible) | `IntegerTextFieldHandle` |  |
| [`assertInvisible()`](#assertinvisible) | `IntegerTextFieldHandle` |  |

### getText()

```java
String getText()
```

The current text in the field.

### getValue()

```java
@Nullable Integer getValue()
```

The current value as an `Integer`, or `null` if the field is empty or invalid.

### setText(String)

```java
IntegerTextFieldHandle setText(String text)
```

Set the field's raw text.

### setValue(int)

```java
IntegerTextFieldHandle setValue(int value)
```

Set the field's value as an integer.

### clear()

```java
IntegerTextFieldHandle clear()
```

Clear the field.

### assertText(String)

```java
IntegerTextFieldHandle assertText(String expected)
```

Assert the current text equals the expected value.

### assertValue(int)

```java
IntegerTextFieldHandle assertValue(int expected)
```

Assert the current integer value equals the expected value.

### assertEnabled()

```java
IntegerTextFieldHandle assertEnabled()
```

### assertDisabled()

```java
IntegerTextFieldHandle assertDisabled()
```

### assertVisible()

```java
IntegerTextFieldHandle assertVisible()
```

### assertInvisible()

```java
IntegerTextFieldHandle assertInvisible()
```

