Okay so i am having a little trouble with my JFormattedTextField. I figured out how to work the MaskFormatter somewhat but not great. the formatting is fine, like when I want to restrict a field to only 15 characters that works but when I move the cursor to another field the text disappears. Not sure whats going on there. I can't find anything about it in the API... although I am quite new at using it so I may simply be looking in the wrong areas. here is a snippit of code that contains the JFormattedTextField:
JFormattedTextField nameArea = new JFormattedTextField(createFormatter("AAAAAAAAAAAAAAA"));
// creates a MaskFormatter and makes sure the formating is correct
// taken from java.sun.com
protected MaskFormatter createFormatter(String s)
{
MaskFormatter formatter = null;
try
{
formatter = new MaskFormatter(s);
}
catch (java.text.ParseException exc)
{
System.err.println("formatter is bad: " + exc.getMessage());
System.exit(-1);
}
return formatter;
}