---
title: "NumberField"
url: "https://reference.aspose.com/pdf/java/com.aspose.pdf/numberfield/"
product: "Aspose.PDF for Java API Reference"
description: "Text Field with specified valid chars @see TextBoxField"
---

**Inheritance:**
java.lang.Object, com.aspose.pdf.BaseParagraph com.aspose.pdf.Annotation com.aspose.pdf.WidgetAnnotation com.aspose.pdf.Field com.aspose.pdf.TextBoxField com.aspose.pdf.NumberField, com.aspose.pdf.BaseParagraph, com.aspose.pdf.Annotation com.aspose.pdf.WidgetAnnotation com.aspose.pdf.Field com.aspose.pdf.TextBoxField com.aspose.pdf.NumberField, com.aspose.pdf.Annotation, com.aspose.pdf.WidgetAnnotation com.aspose.pdf.Field com.aspose.pdf.TextBoxField com.aspose.pdf.NumberField, com.aspose.pdf.WidgetAnnotation, com.aspose.pdf.Field com.aspose.pdf.TextBoxField com.aspose.pdf.NumberField, com.aspose.pdf.Field, com.aspose.pdf.TextBoxField com.aspose.pdf.NumberField, com.aspose.pdf.TextBoxField, com.aspose.pdf.NumberField

**All Implemented Interfaces:**
com.aspose.ms.System.Collections.Generic.IGenericEnumerable< WidgetAnnotation >, com.aspose.ms.System.Collections.IEnumerable< WidgetAnnotation >, com.aspose.ms.System.ICloneable, Cloneable, Iterable < WidgetAnnotation >

```
public class NumberField extends TextBoxField
```

Text Field with specified valid chars @see TextBoxField

## Constructors

| Constructor | Description |
| --- | --- |
| [NumberField](#NumberField--) | Initializes a new instance of the {@link NumberField} class. |
| [NumberField](#NumberField-com.aspose.pdf.Document-com.aspose.pdf.Rectangle-) | Initializes a new instance of the {@link NumberField} class. |
| [NumberField](#NumberField-com.aspose.pdf.Page-com.aspose.pdf.Rectangle-) | Initializes a new instance of the {@link NumberField} class. |

## Methods

| Method | Description |
| --- | --- |
| [getAllowedChars](#getAllowedChars--) | Gets or sets the allowed chars. Value: The allowed chars string. 0123456789 by default |
| [setAllowedChars](#setAllowedChars-java.lang.String-) | Gets or sets the allowed chars. Value: The allowed chars string. 0123456789 by default |

### NumberField {#NumberField--}
```
public NumberField()
```

Initializes a new instance of the {@link NumberField} class.

### NumberField {#NumberField-com.aspose.pdf.Document-com.aspose.pdf.Rectangle-}
Initializes a new instance of the {@link NumberField} class.

### NumberField {#NumberField-com.aspose.pdf.Page-com.aspose.pdf.Rectangle-}
Initializes a new instance of the {@link NumberField} class.

### getAllowedChars {#getAllowedChars--}
```
public final String getAllowedChars()
```

Gets or sets the allowed chars. Value: The allowed chars string. 0123456789 by default

**Returns:**
String value

### setAllowedChars {#setAllowedChars-java.lang.String-}
Gets or sets the allowed chars. Value: The allowed chars string. 0123456789 by default
