NycNessyness 0 Junior Poster in Training

Hello. I now know how to allow the user to enter only numeric input in a FormattedTextField. What I need help with now is how to allow the user to only input letters. An example is what I have below. The problem I keep getting is it won't allow me to input letters, along with numbers.

public MaskFormatter twocreateMaskFormat(String ft)
    {
   		MaskFormatter nFormat = null;

   		try
   		{

   			nFormat = new MaskFormatter(ft);
   			nFormat.setValidCharacters("ABCDEFGHIJKLMNOPQRSTUVWXYZ");

   		}
   		catch (java.text.ParseException e)
   		{
      			e.printStackTrace();
		}

		return nFormat;

	}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.