Capitalize First Letter Of Each Sentence Of A StyledDocument

Part of this method is taken from an existing post I published on how to capitalize the first letter of every sentence in a String using Java. I used the same logic to incorporate it into the contents of a Document object.

While I used StyledDocument in the title of my post, this can actually work on other kind of documents like HTMLDocument. You just need to add a DocumentListener to the document object and pass the DocumentEvent as the parameter.

Related Posts Plugin for WordPress, Blogger...

Leave a Reply

Your email address will not be published. Required fields are marked *