here\'s the code that i have on how to limit the character input length
class JTextFieldLimit extends PlainDocument { private int limit; // optional uppe
public static boolean validateInt(String txt) { String regx = "^[(0-9),;]+$"; Pattern pattern = Pattern.compile(regx, Pattern.CASE_INSENSITIVE); Matcher matcher = pattern.matcher(txt); boolean b = matcher.find(); return b; }