From: Daniel Pitts on
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.

To be specific, The goal is to provide red-underlined text for
misspelled words, and allow easy correction from a pop up/context menu.


--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
From: Jim Janney on
Daniel Pitts <newsgroup.spamfilter(a)virtualinfinity.net> writes:

> 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.
>
> To be specific, The goal is to provide red-underlined text for
> misspelled words, and allow easy correction from a pop up/context
> menu.

This one does all of that.

http://www.wintertree-software.com/dev/ssce/javasdk.html

--
Jim Janney
From: Daniel Pitts on
On 7/15/2010 12:43 PM, Jim Janney wrote:
> Daniel Pitts<newsgroup.spamfilter(a)virtualinfinity.net> writes:
>
>> 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.
>>
>> To be specific, The goal is to provide red-underlined text for
>> misspelled words, and allow easy correction from a pop up/context
>> menu.
>
> This one does all of that.
>
> http://www.wintertree-software.com/dev/ssce/javasdk.html
>
Thanks.
I did forget to mention that free is very important, and open-source is
a big nice-to-have.
--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
From: Joshua Cranmer on
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...

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
From: Arne Vajhøj on
On 15-07-2010 17:25, Joshua Cranmer wrote:
> 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.

Arne