Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.
/ MaskedTextField Public archive

MaskedTextField is an component similar to JFormmatedText field and can be used in same way.

License

Notifications You must be signed in to change notification settings

gbfragoso/MaskedTextField

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MaskedTextField

This component is very similar to JFormmatedText field and can be used in same way. Including the functionalites of copy|paste content, dinamically change placeholder and mask.

The following table shows the characters that you can use in the formatting mask:

Character Description
# Any valid number (Character.isDigit)
' Escape character, used to escape any of the special formatting characters.
U Any character (Character.isLetter). All lowercase letters are mapped to uppercase
L Any character (Character.isLetter). All uppercase letters are mapped to lowercase
A Any character or number (Character.isLetter or Character.isDigit)
? Any character (Character.isLetter)
* Anything
H Any hex character (0-9, a-f or A-F)

Demonstration

Working mask

Using in JavaFX code (without FXML)

// Created mask for phone with default placeholder "_"
MaskedTextField text = new MaskedTextField("(###)#####-####"); // Only Number

// Change placeholder to empty space
text.setPlaceHolder(' ');

// Change mask
text.setMask("((####))");

Using in FXML

<?import packagepath.MaskedTextField?>

<MaskedTextField mask="(###)#####-####" plainText="5555"/>

The available tags to use in FXML are: mask, placeholder and plainText;

About

MaskedTextField is an component similar to JFormmatedText field and can be used in same way.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages