On 07/15/2010 02:36 PM, Daniel Pitts wrote:
I'd like to emulate the Firefox/thunderbird real-time spell-checking
feature in a (signed) Java applet. Right now, the user is entering data
in a JTextArea, but I'm willing to replace that, as long as the
replacement has word-wrap.
If there are good libraries available that don't have UI integration,
that's fine too, I can probably handle that part myself. Grammar
suggestion is a nice-to-have. I only need, and will probably only ever
need English correction.
Hunspell is what Mozilla code is currently using, and Google suggests
that there exists Java bindings: <http://dren.dk/hunspell.html>. That
only gets whether or not a word is misspelled as well as suggestions for
the word.
The UI should be fairly simple. You can use the Highlighter class
(DefaultHighlighter is probably sufficient to use), as well as text
modification listener to figure out when words are being added, to tell
the text to only highlight a portion of the text. I'm not sure if
highlighters shift their ranges in response to text modification, though...
Native code could be a problem in a Java applet.