Hello. I asked last week about how to allow the user to only enter in letters. I tried the mask formatter but that's too limited. How can I go about letting the user to enter in any kind of letters they want but restricted to only 25 letters for their name. The user shouldn't be allowed to enter anything that is not a letter. This is an example of the code that I have tried that came close, but the user has to enter 15 letters and no less, which is irritating. May someone please assist me on this. Thanks in advance!
JFormattedTextField lastName= new JFormattedTextField(MaskFormat());
public MaskFormatter MaskFormat()
{
MaskFormatter nameFormat = null;
try
{
nameFormat = new MaskFormatter("ULLLLLLLLLLLLL");
}
catch (java.text.ParseException exc)
{
}
return nameFormat;
}