Back to Projects

PhoneNumberFX

A JavaFX control for entering and validating international phone numbers, backed by Google's libphonenumber.

Screenshots

PhoneNumberFX — international number input

Key Features

250+ Countries

Supports phone number formats for every country in the world.

Real-time Validation

Validates numbers on-the-fly using Google's libphonenumber library.

Country Flag & Code

Shows the country flag and dialling code prefix inside the text field.

Format on Commit

Optionally formats the number when focus is lost or Enter is pressed.

Phone Label

A companion label control that formats stored numbers in national or international format.

Home Country Mode

Displays numbers from the home country in national format; others with country code.

Getting Started

Add the dependency to your project:

Maven
<dependency>
  <groupId>com.dlsc.phonenumberfx</groupId>
  <artifactId>phonenumberfx</artifactId>
  <version>1.5.0</version>
</dependency>
Gradle
implementation 'com.dlsc.phonenumberfx:phonenumberfx:1.5.0'