https://github.com/gbfragoso/maskedtextfield
MaskedTextField is an component similar to JFormmatedText field and can be used in same way.
https://github.com/gbfragoso/maskedtextfield
javafx javafx-8 javafx-library jformmatedtext-field mask
Last synced: 5 days ago
JSON representation
MaskedTextField is an component similar to JFormmatedText field and can be used in same way.
- Host: GitHub
- URL: https://github.com/gbfragoso/maskedtextfield
- Owner: gbfragoso
- License: mit
- Archived: true
- Created: 2017-08-02T01:24:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-08-26T14:15:09.000Z (over 2 years ago)
- Last Synced: 2024-12-26T00:26:39.516Z (about 2 months ago)
- Topics: javafx, javafx-8, javafx-library, jformmatedtext-field, mask
- Language: Java
- Homepage:
- Size: 106 KB
- Stars: 22
- Watchers: 4
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 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

# Using in JavaFX code (without FXML)
``` java
// 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
``````
The available tags to use in FXML are: mask, placeholder and plainText;