Engineering and Senior Developer, HTML5, CSS3, JavaScript, PHP, Python, Java, Android Developer, friend and father.
RestrictedTextField is a small library inspired in the limited behavior of Swing componen provides, one of the common problems in use the component, it is very complex to manage the content that is being written, that is, there is no way to automatically validate the user to type certain characters we want, unless it is by manual code.
It is for this reason that theRestrictedTextFieldlibrary provides an easy way to manipulate the component providing some utility functions that could benefit more than one person.
The lastest version contain the next functions
The library use is realy very simple
import Atxy2k.CustomTextField.RestrictedTextField;
RestrictedTextField library provide some methods to your easy use
Assign the text field write a limit, for example, if we were using a zip code, the limit would be 5. By default the text field limit is 20 characters.
Merely in the text field you can type only numbers (not including spaces), the default value is false.
Merely in the text field only you can type text (not including spaces), the default value is false.
Allows the blanks in the text field, regardless of whether any of the above methods has been executed, the default value is false
Merely in the text field can be written only alphanumeric characters (not including spaces), the default value is false.
Resets the jtextfield to default configuration
Merely in the text field can be written only certain characters that we provide these, also, are introduced into a text string as the second parameter of the constructor
r1 = new RestrictedTextField(campoTexto, "abcde");