How to add spell check in JTextArea?

I have a small Java application that has a JTextArea where the user enters text. I would like to add spell checking capabilities to this component, similar to how Microsoft Word does it, i.e. Erroneous words are underlined, and a corrections pop-up menu is displayed when the user right-clicks on the underlined word. Are there open source libraries for adding this feature to JTextAreas?

+7
java spell-checking
source share
2 answers

You can implement your own spellcheck with a dictionary (it can be quite large depending on the supported languages), and then distance metrics are calculated from the words in the text box in the dictionary. Underline can be done by styling the font, there as a sample applet here .

Jaspell is the Java implementation of the popular Aspell. It has some explanations for the search algorithms used.

As mentioned earlier, Jazzy is also great, and IBM provides a good tutorial .

+2
source share

I have not tried this before, but I came across this a while ago: http://sourceforge.net/projects/jazzy/

+1
source share

All Articles