Limit the words usage in the text field

Hi there,I need some help here. Is there any method that I can use to limit the usage the words in the text field. Its very helpful to me.Thanks
[165 byte] By [eastern_paladina] at [2007-10-2 8:19:30]
# 1
Override PlainDocument and use that in your text field.
itchyscratchya at 2007-7-16 22:18:25 > top of Java-index,Desktop,Developing for the Desktop...
# 2
can you be more specific?
eastern_paladina at 2007-7-16 22:18:25 > top of Java-index,Desktop,Developing for the Desktop...
# 3
[url= http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html#filter]Implementing a Document Filter[/url]
74philipa at 2007-7-16 22:18:25 > top of Java-index,Desktop,Developing for the Desktop...
# 4

you can use jformattedfieldtext and use maskformatter to give it a format to limit the number of characters, for example:

MaskFormatter formatter = null;

try {

formatter = new MaskFormatter("####"); //4 numbers only

} catch (java.text.ParseException exc) {

System.err.println("formatter is bad: " + exc.getMessage());

System.exit(-1);

}

JFormattedTextField jFormattedTextField = new JFormattedTextField(formatter);

good luck

cerveceroa at 2007-7-16 22:18:25 > top of Java-index,Desktop,Developing for the Desktop...
# 5
Hi i will like to know that is there any other way to limited the JFormattedTextField to 160 character?
cashgoha at 2007-7-16 22:18:25 > top of Java-index,Desktop,Developing for the Desktop...