Originally posted by Anand Loni: I want to limit 80 characters on each line in JTextArea. I have set my own document on JTextArea and I am overriding insertString method to check length. But I am unable to do this.
This approach should be workable. (You probably also want to override the replace() method.)
Why don't you show us the insertString() code so we can analyze what went wrong?