how can i restrict JTextPane into 3 lines of data

hi all,i want to restrict JTextPane into 3 lines of datauser can not enter data more than 3 line.give me a suggestionsthanksdaya
[170 byte] By [dayanandabva] at [2007-10-3 9:46:15]
# 1
You could try using a [url http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html#filter]DocumentFilter[/url]. If the input string contains a newline character then you would need to check the Document to see how many lines of text it already contains.
camickra at 2007-7-15 5:03:02 > top of Java-index,Desktop,Core GUI APIs...
# 2
thanks camickr for your qucik replay.one clarification, JTextPane atuomatical wraps the content, is it addes the newline character for every line.thanksdaya
dayanandabva at 2007-7-15 5:03:02 > top of Java-index,Desktop,Core GUI APIs...